Question: How to Write Python Script in Linux?
Contents Using the Standard Linux Installation Navigate to the Python Download Site with Your Browser. Click the Appropriate Link for Your Version of Linux...
Contents
Using the standard Linux installation
- Navigate to the Python download site with your browser.
- Click the appropriate link for your version of Linux:
- When asked whether you want to open or save the file, choose Save.
- Double-click the downloaded file.
- Double-click the Python 3.3.4 folder.
- Open a copy of Terminal.
How do I run a Python script in Linux?
Linux (advanced)[edit]
- save your hello.py program in the ~/pythonpractice folder.
- Open up the terminal program.
- Type cd ~/pythonpractice to change directory to your pythonpractice folder, and hit Enter.
- Type chmod a+x hello.py to tell Linux that it is an executable program.
- Type ./hello.py to run your program!
Must Read
How do you code python 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. As long as you save it with the .py extension, it can be executed in the terminal window.