Python: Accessing Windows mapped network drive with known URL, but unknown drive letter

前端 未结 4 1241
南方客
南方客 2021-02-10 07:21

I am trying to write a Python script that can move and copy files on a remote Linux server. However, I can\'t assume that everyone running the script (on Windows) will have mapp

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-10 08:00

    Easy solution is to use forward slashes to specify the Universal Name Convention (UNC):

    //HOST/share/path/to/file
    

    Found this solution in another thread and felt it would be relevant here. See original thread below:

    Using Python, how can I access a shared folder on windows network?

提交回复
热议问题