使用帐户和密码访问目录

时间:2021-01-22 09:08:18

标签: python pathlib

我正在使用 python lib - Pathlib 访问需要 Acc & Pwd 的目录中的文件。

以下是我当前的代码:

FILE_PATH = "//192.168.10.1/Test/test.xlsx"
fileDir = pathlib.Path(FILE_PATH)
if (fileDir.exists() == False):
        print('File not found.')

我得到了这个结果:

[WinError 1326] The user name or password is incorrect: '\\\\192.168.10.1\Test\'

如果登录详细信息是:

account: root, pwd: 123456

我应该如何修改代码才能访问文件?

0 个答案:

没有答案