Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python IDE on Linux Console

Tags:

python

shell

vi

This may sound strange, but I need a better way to build python scripts than opening a file with nano/vi, change something, quit the editor, and type in python script.py, over and over again.

I need to build the script on a webserver without any gui. Any ideas how can I improve my workflow?

like image 340
Henrik P. Hessel Avatar asked Aug 19 '09 17:08

Henrik P. Hessel


People also ask

Can I use Python in Linux terminal?

Running a Script Open the terminal by searching for it in the dashboard or pressing Ctrl + Alt + T . Navigate the terminal to the directory where the script is located using the cd command. Type python SCRIPTNAME.py in the terminal to execute the script.

How do I open Python editor in Linux?

Open a terminal window and type 'python' (without the quotes). This opens python in interactive mode. While this mode is good for initial learning, you may prefer to use a text editor (like Gedit, Vim or Emacs) to write your code.

How do you run Thonny in terminal?

Start Thonny by clicking on the Raspberry Pi icon followed by Programming > Thonny Python IDE. Write your program in the top pane, click File > Save as... to save it, and click Run > Run current script to execute the program.


1 Answers

put this line in your .vimrc file:

:map <F2> :w\|!python %<CR>

now hitting <F2> will save and run your python script

like image 154
anteatersa Avatar answered Oct 18 '22 18:10

anteatersa