Python 2.7 我可以在python中的os.path.ismount()中使用通配符吗

Python 2.7 我可以在python中的os.path.ismount()中使用通配符吗,python-2.7,Python 2.7,我想检查是否存在/decrypt*装载点。我最好的猜测是在os.path.ismount()中使用通配符,但它不起作用。然后我可以做什么您可以使用它将通配符扩展为一个候选列表,以传递给os.path.ismount for path in glob.glob(pattern): if os.path.ismount(path): print(path) # Or do whatever else you want to do with the mounts. Thna

我想检查是否存在/decrypt*装载点。我最好的猜测是在os.path.ismount()中使用通配符,但它不起作用。然后我可以做什么

您可以使用它将通配符扩展为一个候选列表,以传递给
os.path.ismount

for path in glob.glob(pattern):
    if os.path.ismount(path):
        print(path)  # Or do whatever else you want to do with the mounts.

Thnaks babbageclunk@它在我的用例中工作得非常好