Python Essentials

Python Essentials

Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C++ or Java. The language provides constructs intended to enable clear programs on both a small and large scale.

Python supports multiple programming paradigms, including object-oriented, imperative and functional programming or procedural styles. It features a dynamic type system and automatic memory management and has a large and comprehensive standard library.

Python interpreters are available for installation on many operating systems, allowing Python code execution on a wide variety of systems. Using third-party tools, such as Py2exe or Pyinstaller,Python code can be packaged into stand-alone executable programs for some of the most popular operating systems, allowing for the distribution of Python-based software for use on those environments without requiring the installation of a Python interpreter.

Python Essentials

Why python?

  • Fast and simple
  • No need to compiler
  • python is one of the most used language and it is growing
  • Very powerful
  • Cross-Platform

WINDOWS INSTALLATION

Installing Python

https://www.python.org/downloads/ : Go to this link and download latest version based on your OS.

Then install the .msi package which you have just downloaded.

Then you need to add path to “Environment Variables.”

Installing Python Modules

https://pypi.python.org/pypi : The Python Package Index is a repository of software for the Python programming language. In this website you can browse all of the available python packages. For installing these  packages you will need to install pip (tool for installing Python packages.) first.

For browsing and installing python modules you can also visit this website to find the appropriate version of modules for Windows. This website provide you .whl (wheel) extensions of the python packages which is a built-package format for Python.

Installing pip

Go this website : https://pip.pypa.io/en/stable/installing.html and download the get-pip.py

Then you need to add path to “Environment Variables.” for Scripts folder which is located under C\Python34\Scripts

To do that, Right Click on your computer icon, select “Proporties”.  When you get there select “Advanced System Settings” on the left panel menu.

Python Essentials

Then select “Environemnt Variables”

Python Essentials

After that find “Path” inside “system variables” then double click on it. Add these paths if they aren’t already there.

Python Essentials

You can now test python and pip. Open your cmd and type

Python Essentials

You should see the version indormations if your install was successful.

Then type

Python Essentials

You should see the pip parameters if your install was successful.

After installing latest version of python and pip now you can install python modules using “pip install” command. To intall whl. extension file package open up your cmd then cd the directory of the package and type

Syntax;

You can visit here to find best python libraries : https://github.com/vinta/awesome-python

MAC INSTALLATION

Installing Python

https://www.python.org/downloads/ : Go to this link and download latest version based on your OS.

Then install the .pkg file which you have just downloaded.

Python 2.7.9+ and Python 3.4+ versions ship with “pip” so you don’t have to install pip if you have latest version of python.

Installing Libraries

libraries which are .whl extensions can be installed using pip install command.

For example if you want to install matplotlib python library, first thing you should do is downloading the .whl file. This is the package file for python. I downloaded the file and put it to the folder named PythonLibs  Then cd the location of the package file in my terminal.

Python Essentials

As you can see python automatically installed other related libraries for me. In this case matplotlib requires dateutil, pytz,six,numpy,pyparsing and nose. In windows version of python sometimes you have to install these related libraries manually.

Links

 

Leave a Reply

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