Easy console / IDE for Python?

I often use ipython(or a regular python shell) to check for snippets of python code during coding, and this was very useful. One of the drawbacks of this, however, is that if I want to test a multi-line code segment or want to write several lines of code before running, it is not very convenient to do it “line by line”. And even returning to changing some lines is cumbersome because you need to re-enter all the code that appears after it.

Now I play with Groovy, and I believe that he has an excellent solution to this problem: Groovy Console , you just write all the code you want, it's just like a regular editor; and then you press Ctrl + R (Cmd + R actually, since I'm on a Mac) and it launches all at once. If you want to change something (for example, if there are errors), then this is also easy - just change it and Ctrl + R again.

Is there an equivalent to this for python? Or do you have any recommendations for achieving similar behavior? I could just create a new file, save it, and then python <filename>.pyfrom the shell. But it is too many steps and will be bulky. Eclipse may be an option, but it is too heavy. I am really looking for something easy that I can just spin up when I want to check something and then get rid of it just as quickly.

I would be interested to hear any ideas / suggestions!

thank

+3
source share
4 answers

DreamPie. groovyConsole, , DreamPie / ( " " " " ). , , , , -, groovyConsole, (Ctrl + Up) " ".

+4

IDLE, Python? <filename>.py IDLE, F5.

Python IDLE, , .

+3

I am using emacs and its python mode.
C-c C-c: displays the current buffer
but you can also define the area (i.e. selection), functions, etc.

You can even use python-mode to use ipython (like me).
See http://ipython.scipy.org/dist/ipython.el . It works great

+2
source

Have you tried PyCrust? It has excellent multi-line editing, copy / paste support.

PyCrust can be found in wxPython Docs and Demos .

+1
source

Source: https://habr.com/ru/post/1790862/


All Articles