How can I open python file (from desktop) with IDLE, using Terminal on Ubuntu 12.04?
I have tried to do this way:
$ idle open python_file.py
Instead of open my file it's create two more files:
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
You do not need to use the 'open' term. The help says:
idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ... -c command run this command -d enable debugger -e edit mode; arguments are files to be edited -s run $IDLESTARTUP or $PYTHONSTARTUP first -t title set title of shell window
You can just do this:
idle file_you_want_to_open.py or idle.py file_you_want_to_open.py
If the file doesn't exist then it will be created.
You can also directly open idle by typing :
in the terminal and then click on
File >> New File or Open File
option to select or open your file , write your program and execute it . However I would recommend you to use the "terminal" and a "text editor" like
rather than using "idle" .
PS: You might already know about these text editors , however I mentioned it in case somebody else new views this article and maybe it comes in handy .
If you want to get your command prompt back after executing
idle you could use:
nohup idle /some/path/to/file.py &
or if the file is in your current directory:
$ ls file.py $ nohup idle file.py &
Of course the last one will work if you are in the current directory, if the file do not exist IDLE will create one.