Friday, September 25, 2015

Python Hunt Series - Scripts, Modules and Packages

Python Hunt Series - Scripts, Modules and Packages

prev post in the series - Isolated Environment

In this post, let's discuss about scripts, modules and packages in python.

Before getting into packages, lets discuss on modules and scripts. A file with .py extension when ran from the terminal is called as script where as when imported called as module. 

A script can solve any purpose. Lets assume we have a need to start a server instance. we can write a script that starts the server instance. similarly we can also write a script to stop the server instance. In-fact we can write a single script that takes input as either start or stop and does it accordingly

Thursday, September 24, 2015

Python Hunt Series - Isolated Environment


Python Hunt Series - Isolated Environment 

Prev post in the series - Scaffolding


In this post, we will discuss about the virtual environment option available in Python. Virtual environment creates isolated environment which will provide us the opportunity to install python packages to our convenience without affecting the global python environment

let me give you an use case where virtual environment is must. Consider I am working on 2 projects simultaneously, for my first project I need to use django (web application framework ) version 1.6 and for my second project I need django version 1.8 or greater. In this case I cannot have django 1.6 and >1.8 co existing in the same environment.

Wednesday, September 23, 2015

Python Hunt Series - Scaffolding


Python Hunt Series - Scaffolding

Hi, this is first post in the series " Python Hunt " . To start with, I will talk about setting up environment to work on Python.

At first place we need to install Python. Python comes in 2 major versions, python 2.x and 3.x. If you are starting fresh, I would suggest to go for python 3.

You can read about the difference between python 2 and python 3 from below link