Is it possible to open an IDLE file from the terminal?

Asked

Viewed 1,258 times

2

IDLE allows you to open a file to write our programs (by loading CRTL + N, if I’m not mistaken), but due to a problem with Python IDLE 3.4.1 or 3.4.0, I cannot use it properly. I can only use Python through the terminal.

It is possible to open a file with IDLE from the terminal?

  • The question was how to open/create an IDLE file from the terminal? I edited and answered considering it was.

  • 1

    OK Rinzler, thank you for clarifying. I hope the question and the answers help someone else!

2 answers

4

The Python interpreter only runs Python programs, it does not come with a built-in editing interface. What you can do is use a text editor to write your program (anyone but Word serves: Notepad++, Scite, Gedit, Emacs, Vim, etc...) and then pass the file you created to the python interpreter usandl the command line.

If you create a file meuprograma.py you can run it on the terminal using

python meuprograma.py

If you want to load your program within a Python interactive loop you can use the -i flag

python -i meuprograma.py

4


You can open any file (including a new one, already giving it a name), simply by typing in the terminal:

idle arquivo.py

Browser other questions tagged

You are not signed in. Login or sign up in order to post.