How To Run Python3.X In Ubuntu (Linux)?

in this article, we discuss How To Run Python3.X In Ubuntu (Linux)?

How To Run Python3.X In Ubuntu (Linux)?

How To Run Python3.X In Ubuntu (Linux)?
How To Run Python3.X In Ubuntu (Linux)?

How To Run Python3.X In Ubuntu (Linux)?

What is Python?

So let me clear the air by formally introducing to you what is Python. Python is a high levelinterpreted language which has easy syntax and dynamic semantics. Python is much easier than other programming languages and helps you create beautiful applications with less effort and much more ease.

Why Python?

You would wonder why use Python anyways? Let me help you understand using the keywords in the formal definition of Python.

  • High LevelPython derives components from the natural language that we humans use to communicate with each other. This makes it easier for anyone to try and relate what exactly could be happening without the burden of going through tons of machine code.
  • InterpretedPython codes are compiled line-by-line which makes debugging errors much easier and efficient. But this comes at a cost as it is much slower than other programming languages.
  • Easy SyntaxPython makes use of indentations instead of braces to distinguish what blocks of code come under which class or function. This makes the code look well distributed and makes it easy for anyone to read it.
  • Dynamic SemanticsIf you are an old school coder, you would know that before using anything, you would need to initialize it. It does all of this dynamically.

How To Run Python3.X In Ubuntu (Linux)?

Python Features

Python is slow. However, its popularity does not stop to grow as it can achieve better productivity with lesser code, making Python one of the most liked languages. Python has a list of features that attract almost anyone to start coding with it.

  • SimplicityPython is its own kind of simple. All you need to know is how the indentations work and you can code the most complex of problems in the fewer lines of code.
  • Open SourcePython is free for anyone to use. You even have the freedom to modify the code of Python to better your own needs without facing any repercussions.
  • PortabilityCode writing can be done once and run across different systems without any changes. This makes it super helpful when a team works on a project.
  • Embedding PropertiesPython allows the code of other languages such as CC++ to be embedded, which makes it much more powerful and versatile.
  • InterpretationAs you know, Python is compiled line-by-line, making debugging easier and memory management much more efficient
  • Library SupportPython supports libraries that you can use and get started off to obtain your solutions much faster and easier. And the community for these libraries is very active and helpful
  • OOPSObject-Oriented concepts help you replicate real-world scenarios in your code and also provide security to them so that you can obtain a well-made application

Research and statistical data have proven that Python is the most growing language of all time. Using the TIOBE’s package which keeps track of the popularity growth, we obtain the following data.

Rank on Mar 2018Rank on Mar 2019LanguageRating
11Java14.8%
22C13.3%
43Python8.2%
34C++8.1%
65Visual Basic .NET6.4%
How To Run Python3.X In Ubuntu (Linux)?

How To Run Python3.X In Ubuntu (Linux)?

If you are curious about how to run Python in Ubuntu, here’s an article dedicated for it which may help you out. We are here using Ubuntu Version 14.04. It supports Python 2 and Python 3 versions.

So here is the first step to learn How To Run Python3.X In Ubuntu (Linux)?

ubuntu 1
How To Run Python3.X In Ubuntu (Linux)?

Step1:  Open your desktop like this.

ubutu 2
How To Run Python3.X In Ubuntu (Linux)?

Step2: Go for Files > Documents in the left hand side.

ubuntu 3
How To Run Python3.X In Ubuntu (Linux)?

Step3:  In documents, you can either go for a folder in which you want to save your program or directly make a program there itself.

ubuntu 4
How To Run Python3.X In Ubuntu (Linux)?

Step 4: Right click in that area and select a New Document > Empty document.

ubuntu 5

Step 5: Name your file with a .py extension so that the system can detect it is a python file.

ubuntu 6

Step 6: Open your file and you’ll find out the file opens in ‘gedit’.

Write down your desired program in the given area and save it.

ubuntu 7

How To Run Python3.X In Ubuntu (Linux)?

Step 7: Open Terminal in left hand side down corner.

Step 8: Once done, we have to change the directory so that it’s easy access for us to fetch the code.

Step 9: For that the linux command is cd Documents/ wherever your file is saved.

Step 10: Once done, enter and you are in that particular directory.

Step 11: Now to run your Python file, all you have to command is ‘python yourfilename.py’.

Step 12: It basically tells the terminal to run the python file.

ubuntu 8

Step 13: In case if you want to check which version of Python are you using, you can write python –version.

Step 14:  Instead of using Python 2 version, if you use Python 3 version, you can readily execute it by writing ‘python3 yourfilename.py’.

Step 15: Make sure while executing your Python code in Python 3 version, you use the syntax according to Python 3. Example : Python 2 print statement may or may not have ( ) with print statements but in Python 3, print statements should be with ().

ubutu 9

I hope that you learnt the concepts well and hence try it out to be more accurate. This brings us to the end of this article on How To Run Python3.X In Ubuntu (Linux)?

Also Checkout Install Python On Windows – Python 3.X Installation Guide

If you interested in Entertainment genre please check this also Celebrity Birthday Today

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *