我無法弄清楚如何創建不存在的文件。我嘗試了下,但我得到錯誤,該文件不存在。如果不存在,Python不會創建文件
請指導。
f=open('c:\Lets_Create_Malware\output.txt', 'r+')
f=open('c:\Lets_Create_Malware\output.txt', 'w+')
f=open('c:\Lets_Create_Malware\output.txt', 'a+')
f=open('c:\Lets_Create_Malware\output.txt', 'r')
f=open('c:\Lets_Create_Malware\output.txt', 'w')
f=open('c:\Lets_Create_Malware\output.txt', 'a')
[Open in Python does not create a file if not exist](http://stackoverflow.com/questions/2967194/open-in-python-does-not-create-a-file)如果它不存在) – paisanco
http://stackoverflow.com/questions/16333569/mixed-slashes-with-os-path-join-on-windows – dmitryro