What is the best way to map windows drives using Python?

后端 未结 7 1597
孤城傲影
孤城傲影 2020-11-28 05:08

What is the best way to map a network share to a windows drive using Python? This share also requires a username and password.

相关标签:
7条回答
  • 2020-11-28 05:46

    An alternative to subprocess:

    import os
    
    os.system("net use m: \\\\shared\folder")
    

    Or

    import os
    
    cmd = "net use m: \\\\shared\folder"
    os.system(cmd)
    
    0 讨论(0)
提交回复
热议问题