How to open my .py script from anywhere on my pc directly into python idle form command prompt?
Is there any way so that i can typeidle test.py on cmd so that it opens the test.py file in the current directory and if test.py is not available creates a new file and opens it into idle
You can do that by adding the directory where you have installed the idle editor the PATH environment variable.
How to do that depends on your operating system: just search the Internet for add directory to path plus your operating system: e.g. Windows/Ubuntu, etc.
After changing the environment variable it may be a good idea to restart your PC (to make sure that all programs use the updated version)
You can right click on the idle then you will can see location of it in the properties tab
Navigate to that location and call as below
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Python 2.7>"IDLE (Python GUI).lnk" C:\Python27\projects\ping.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With