How to access password protected shared folder through python

女生的网名这么多〃 提交于 2020-01-17 05:30:09

问题


I have a python script that creates folders having name 'A' , 'B', 'C' upto 'Z' and then moves the folders currently present in the directory to these created folder on the basis of their first character ie folder named 'Stackoverflow' will go to the folder 'S' and so on.
Now the thing is that first i have to give the path of the directory that contains these folders, but my directory is a shared folder from a computer connected to the network which is password protected. Every time I try

    os.chdir(path_of_the_folder_on_password_protected_harddisk)

Now If I just try to access the harddisk through my file explorer then it prompts for id and password which i enter correctly and then run my python script then it works.
But if i try to access the hard disk through the script it shows error.
I want to know how can I pass the id and password as argument to access the hardddisk through the python script directly without going to the file explorer.

来源:https://stackoverflow.com/questions/37967752/how-to-access-password-protected-shared-folder-through-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!