使用 Python 访问共享驱动器中的文件

时间:2021-05-25 09:34:02

标签: python-3.x

我正在使用 Python 3 并且对它非常陌生。有人可以告诉我如何检查共享驱动器中是否存在文件。

目前我正在使用:

from pathlib import Path
 my_file = Path(r"\\compname\projectname\abc.txt",'w')
  if my_file.is_file():
    print("SauSau")

没有得到任何输出`

0 个答案:

没有答案