How to Install and Start python in Different OS
What Will I Learn?
In this tutorial you will learn about -
- A Gist about Python
- How to Install python in Different OS
- How to start python in Different OS
Requirements
Need to download python setup files from Python official website.
Difficulty
- Basic
Tutorial Contents
A small Introduction about Python for beginners
Python is a powerful language that is both easy to learn and rich in possibilities.
From the moment you install it on your computer, you have many features built into the language that we will discover throughout this book.
It is, moreover, very easy to extend the existing features, as we are going to see. So, there are so-called libraries that help the developer to work on specific projects. Several libraries can be installed for example, to develop graphical interfaces in Python.
Concretely, that's what we can do with Python: very simple little programs, called scripts, with a very precise mission on your computer; complete programs, such as games, office suites, software multimedia, email clients. . .
very complex projects, such as software packages (multiple software packages can work together, mainly used in the professional world). Here are some of the features provided by Python and its libraries: create graphical interfaces; circulate information through a network; interact in an advanced way with your operating system; . . . and many more. . .
Different versions of Python -
When the Python Software Foundation was created in 2001, and over the years that followed, the Python language went through a series of versions that we have encompassed in the name Python 2.x (2.3, 2.5, 2.6 ...). Since February 13, 2009, the version 3.0.1 is available. This version breaks the upward compatibility that prevailed in the latest versions.
Python Installation
The installation of Python is a breeze, both under Windows and under the Unix systems. Whatever your operating system, you need to go to the official website of Python.
Python official website
In Windows:-
1 . Click the Download link in the main menu of the page.
2 . Select the version of Python you want to use (I suggest you last in date).
3 . You are offered one (or more) link (s) to a Windows version: select the one that will suit your processor. If you have a doubt, download an x86 version. If your computer tells you it can not execute the program, try another version of Python.
4 . Save and run the installation file and follow the steps. This is neither very long and not very difficult.
5 . Once the installation is complete, you can go to the Start menu
All programs. Python should appear in this list.
In Linux:-
Python is pre-installed on most Linux distributions. However, it is possible that you do not have the latest version. To check it, type in a terminal the python -V command. This command returns the version of Python currently installed on your system. It is very likely that this is a version 2.x, like 2.6 or 2.7, for compatibility reasons. In any case, I will recommends to install Python 3.x, the syntax is very close to Python 2.x but still differs. . .
Click download and download the latest version of Python (currently Python 3.2 compressed tarball source (for Linux, Unix or OS X)). Open a terminal, then go to the folder where the archive is located:
1 . Unzip the archive by typing:tar -jxvf Python-3.2.tar.bz2
(this command is of course to adapt according to the version and the type of compression).
2 . Wait a few moments for the decompression to finish, then rendezvous in the folder just created in the current directory (Python-3.2 in my case).
3 . Run the configure script by typing ./configure
in the console.
4 . Once the configuration has taken place, you just have to compile by typing make then make alt install. These commands are intended to compile Python.
The make altinstall
command, in particular, automatically creates links to the installed version. Thanks to altinstall
, you can be sure that the version that you install will not conflict with another already present on your system.
In Mac OS:-
Download the latest version of Python. Open the .dmg
file and double-click on the Python.mpkg
installation package. An installation wizard opens, let yourself be guided: Python is now installed!
How To Start Python
In Windows:-
You have several ways to access the Python command line, the most obvious to go through the menus Start> All Programs> Python 3.2> Python (Command Line)
. If all goes well, you should get a beautiful console. It may be that the information in yours is not the same, but do not worry about it.
You can also go through the Windows command line; because of the shortcuts, I generally prefer this method, but it's a matter of taste. go ahead on the Start menu, and then click Run
. In the window that appears, type just python
and the Python command line should be expensive again.
To close the Python shell, you can type exit.
In Linux:-
When you installed it on your system, Python created a link to the interpreter in the form python3.X (the X being the version number installed).
If, for example, you have installed Python 3.2, you can access it through the command
To close the Python command line, do not use 'CTRL+C' but 'CTRL+D'.
In Mac OS:-
Look for a Python folder in the Applications folder. To launch Python, open the IDLE application for this folder.
Posted on Utopian.io - Rewarding Open Source Contributors
Your contribution cannot be approved because it does not follow the Utopian Rules.
You can contact us on Discord.
[utopian-moderator]