【发布时间】:2013-03-19 22:52:51
【问题描述】:
我看到了许多与使用 Python 和 GAE 编写文件和创建新目录有关的问题,但其中一些人总结(不仅在 SO 上)说 Python 不能 写入文件或创建新目录。然而这些命令是存在的,而且很多其他人似乎在写文件和打开目录也没问题。
我正在尝试写入 .txt 文件并创建文件夹并收到以下错误:
案例#1:
with open("aardvark.txt", "a") as myfile:
myfile.write("i can't believe its not butter")
产生“IOError: [Errno 30] Read-only file system: 'aardvark.txt'”。但我检查过,它的 def-o 不是只读文件。
案例#2:
folder = r'C:\project\folder\' + str(name)
os.makedirs(folder)
产生“OSError: [Errno 38] Function not implemented: 'C:\project\folder'”
我错过了什么?
【问题讨论】:
标签: python google-app-engine python-2.7 file-io directory