Python - 引用重定向文件夹

时间:2014-01-14 13:16:05

标签: python windows python-3.x filepath

从Google Chrome下载的文件位置为:

\\WALL-E\RedirectedFolders\myname\My Documents\Downloads

我如何参考?

我不能像你做C:Drive那样以正常方式引用它。

path='C:\\...'

2 个答案:

答案 0 :(得分:0)

我认为你是在Windows中这样做的。假设你能做的是: - 转到Windows中的“下载”文件夹。 - 点击地址栏,它将为您提供以下内容:

C:\Users\TomHarris\Documents\ViberDownloads

在上面的最后一个附加指定文件的名称。

C:\Users\TomHarris\Documents\ViberDownloads\MYFILETOOPEN

虽然我认为反斜杠和正斜杠都应该正常工作(但我不确定,请检查它!),python中的文件输入遵循惯例,如下所示:

fname= "/WALL-E/RedirectedFolders/myname/My Documents/Downloads"

答案 1 :(得分:0)

path='\\\\WALL-E\\RedirectedFolders\\rmarshall\\My Documents\\Downloads\\'