The phenomenon and background of the problem
Problem related code , Do not paste screenshots
import os
fp=open('hello.txt','w')
fp.write('hello')
fp.close()
os.system('pause')
Operation results and error reporting contents
Double click runtime , The console window is waiting , But there is no new file .
Run or... On the command line idle Everything is normal in .
My solution ideas and tried methods
I have uninstalled the installation again python
What I want to achieve
Refer to the answer 1:
Check that you double-click the runtime path
import osprint(os.getcwd())
The file should be created . But based on the current path , It could be windows Under the default path of .
Refer to the answer 2:
Refer to the answer 3:
Run or... On the command line idle Run in , The running directory is actually in the current directory . Double-click on the run , Should also generate new files , It's just not in the current directory . But in the console Directory . I've often met before .
Refer to the answer 4:
thank