I want build a program to save some documents file. My program run in test folder and i want to save Documents in testsave. I use these way:
File=open("C:\test\save\hello.txt",'w') File.write("hello world") File.close()
Now i copy my program to E driver and run the program then hello.txt make in C driver not in E drive. What should i do to save documents every where past my test folder??
You have the program writing to that absolute file path. If you want it to run in a given directory, just have the name of the file like hello.txt.
hello.txt
2.1m questions
2.1m answers
60 comments
57.0k users