Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Saturday, 4 February 2017

Python - Article 2 : Installation

Installing Python is really quick and easy. So let's follow a few simple steps to setup our own Python Environment...😊

                         
                        Installing Python in Linux:

-Python comes preinstalled in most of the linux flavours.
-To check if python is installed or not open the terminal and type:
                              $python --version
-If python is installed the version will be shown in ouput as follows:
                              Python 2.7.12
-The latest version of python available is 3.6.0
-To update/install latest version in the terminal type the command:
                              $sudo apt-get install python <version>
where <version> represents the required version number.



                        Installing Python in Windows:
-The installer for Windows can be downloaded from the following link:
                 https://www.python.org/downloads/windows/
-Keeping in mind the architecture of the machine(64 bit or so) required installer must be downloaded
-Then go to the downloaded installer and double click on it and run it.
-Python version 3 also automatically sets the path variable for python. But if you are using Python version 2 then in windows command prompt type the command:
                   path %path%;C:\Python
-This can also be done by GUI as follows:
               My Computer>>Properties>>Advanced System    Settings>>Environment Variables>>New>>Name(Enter anything like python or pythonexe)>>Value(Path to Python e.g.C:\Python\)>>Select: 'Add python.exe to path'>>Finish/Save



                         Installing Python in Mac OS:
-The installer for Mac OS can be downloaded from the following link:
                 https://www.python.org/downloads/mac-osx/
-Keeping in mind the architecture of the machine(64 bit or so) required installer must be downloaded
-Then go to the downloaded installer and double click on it and run it.
-For Mac OS the installer itself takes care to setup the path variable.



                         How to run Python...
-To use interactive Python just type 'python' in the terminal as:
     python@python:~$ python
     Python 2.7.12 (default, Nov 19 2016, 06:48:10)
     [GCC 5.4.0 20160609] on linux2
     Type "help", "copyright", "credits" or "license" for more information.
     >>>

-To run a python script type the command in the terminal:
                               $python <script_name.py>

Thursday, 2 February 2017

Python - Article 1 : Introduction




 Now the question arises why should I learn python?





The answer to this is very interesting. Do you want to reduce your workload and enjoy your machine doing your work???Also do you want to be more creative at work???


The answer to the above questions is surely a 'YES'😎😎. So this 'YES' requires one to learn python, write high level compact codes, explore the language and use it for various amazing applications like :

1) Customizing you business software according to your needs to speed work.
2) write scripts for getting digital data from your sensor using microprocessor to analyse it. Example: get data from your proximity sensor to know someone is entering your room. OR get data from weight sensor to know that your milk in refrigerator is over etc.
3)write scripts to automatically play your favourite music playlist when you turn on your computer.
4)you can even ask your computer to do some boring repetitive task efficiently by writing a few lines in python.

So in order to explore Python and apply it in various creative ways let's learn Python through a series of brief articles....

Before knowing about installation of Python lets just see a brief introduction of Python Programming Language

-Python is a high level, object oriented interpreted scripting language.
-It is easy to understand and great to begin programming with.
-Python has a huge standard library and has support for various api's, this makes it a good choice in many applications,customizations,tools etc.