$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Download Python here: https://www.python.org/downloads/
In the terminal, go to the directory containing the downloaded file and run the following command to extract the file. The file name will vary depending on the version you downloaded.
$ tar -xvf Python-3.6.2.tgz
Go to the unzipped folder, enter the command:
$ cd Python-3.6.0
Execute the following commands to compile Python source code on Ubuntu.
$ ./configure
$ make
$ make install
If you are a new user, you should install Sublime Text on your computer to write Python code on Linux. Enter the following command to install:
$ sudo add-apt-repository -y ppa:webupd8team/sublime-text-2
$ sudo apt-get update
$ sudo apt-get install sublime-text
Open Sublime Text, go to File> New File or press Ctrl + N to create a new file.
Save the file with the option name, such as quantrimang-python.py
Write the code and save it:
print("Xin chào!")
Go to Tool> Build (Ctrl + B) and you will see the results of the command line at the bottom of the Sublime Text window.
And so, you've just finished running your first Python program on Ubuntu.
Download Python: https://www.python.org/downloads/
Open the downloaded file to install according to the instructions, a successful installation message will appear when finished
You can use your favorite code-writing application or use Sublime Text (a tool that many programmers love).
Open up your code editor, create a new file, save with the extension .py
Write the following code and save:
print("Xin chào!")
Depending on your code editor that the command to run the code will be different, for Sublime Text press Ctrl + B to see the results when running the command.
So here you have to run the first Python command yourself.
Let's learn another simple program on Python before we start getting used to the basic components of this programming language.
Next article: Keywords and identifiers in Python