问题
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