Is it possible to open a file with IDLE from the terminal?

2

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

Is it possible to open a file with IDLE from the terminal?

    
asked by anonymous 21.09.2014 / 21:56

2 answers

5

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

idle arquivo.py
    
12.01.2015 / 01:00
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 (any one except Word serves: Notepad ++, Scite, Gedit, Emacs, Vim, etc ...) and then pass the file you created to the python interpreter using the command line.

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

python meuprograma.py

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

python -i meuprograma.py
    
21.09.2014 / 23:52