Posts

Showing posts from 2015

pygame installation procedure

Pygame installation procedure in python 2.x in both windows, linux and unix (including Mac OS):
Step 1:pip install wheel

Step 2: Download your corresponding version fromhttp://www.lfd.ucedu/~gohlke/pythonlibs/#pygame

Step 3: python -m pip install pygame-1.2a0-cp27-none-win32.whl


Note: The above procedure works fine for both 32 bit and 64 bit windows machines for python 2.x.

Similar procedure works for python 3.x.

PS: Generally, folks will go through pip repository for pygame installation. But, there is no base pygame package in pip repo. But, there are extension packages like pygameui, ... in pip repository

eval,exec, execfile, compile and py_compile in python

Importance of eval, exec, execfile, compile; and the py_compile module:
eval(str,globals,locals)
This function executes an expression string and returns the result.

>>> eval('2+3')
5
>>> eval("'udhay'*3")
'udhayudhayudhay'


#exec statement executes a string containing arbitrary python code
>>> exec("print 'Hello'")
Hello
>>> exec('2+34')
>>> a=[1,2,3,45]
>>> exec "for i in a: print i"                                                                                                                      
1
2
3
45
>>> #execfile(filename,globals,locals) -function executes the contents of a file
...
>>> execfile("fileName.py")

In [1]: globals={'x':7,'y':10,'birds':['parrot','pigeon','sparrow']}

In [2]: locals={}��������������������������������������������������������������������������������������…

Python installation procedure

Image
Python will come pre-installed in Linux and Machintosh. In windows platform, it need to be manually installed.

Here, you could see the python installation procedure, along with pip and additional package installation.

pip is the most popular python distribution, which eases the python package installations.



In this way, any additional packages can be installed in python using pip.

FORMAT: pip install package-name

Ex1: pip install numpy
Ex2: pip install ipython

Online IDEs/Interpreters for python programming

Online Interpreters are useful in many cases.
Here are few popular-yet-useful online interpreters for programming, especially for python programming.

Many of these online interpreters support both python 2.x and python 3.x, separately.
List of Online IDEs/Interpreters for python programming:repl.itcodeacademy codingground by tutorial-pointCodepad ideoneSkulpt PythonTutorPython Interpreter by holycrosslearnpythonSourceLairTryPythonPython Cloud IDEtechmums Python InterpreterRextesterCodeEnvyCodeLinsterInteractive python shell by Google App Engine PythonAnywhere

https://koding.com/IDE/koding-vm-0/my-workspace

List of popular IDEs used for python programming

Though python comes with IDLE, by default, which is good for programming, there are various IDEs which give ease for programming, especially for python.
IDE is the abbreviation of Integrated Development Environment

IDEs for Python:Komodo IDE by ActiveStatePyCharm by Jetbrains SpyderPython Tools for Visual Studio (PTVS)Eclipse & PyDevWing IDENinja IDEIEP
Almost, all the above IDEs are available across all the major platforms(Linux/Windows/OS X)

Python Software Foundation listed some IDEs in their website.

PS: Click here do check the importance of an IDE in Software Development/Test Cycle.

World made with Python

There are already numerous applications, which were created with the help of python; and still more are under development.
Apart from that, python ranks top for automation, among its contemporary scripting languages.

Software make with pythonApplications:1.Anki, a spaced repetition flashcard program 2.Bazaar, a free distributed revision control system 3.BitTorrent, original client, along with several derivatives 4.Blender 3D (software), 3D art and animation program with a game engine. Allows for Python scripting in the game engine and in modelling and animation. 5.BuildBot, a continuous integration system 6.Calibre, an open source e-book management tool 7.Chandler, a personal information manager including calendar, email, tasks and notes support that is not currently under development 8.Cinema 4D, a 3D art and animation program for creating intros and 3-Dimensional text. Has a built in Python scripting console and engine. 9.Deluge, a BitTorrent client for GNOME 10.Dropbox, a web-based file hos…