Thursday, May 20, 2010

Learn Quickly Creating Professional Looking Desktop Application Using Python - Part 2 of 7




Installing and testing our installations

Quick links to other parts of this blog series:
Part-1 | Part-2 | Part-3 | Part-4 | Part-5 | Part-6 | Part-7 

Basically, all the 5 programs we needed for this tutorial (as listed above) have fairly simple installation procedure. Generally all you have to do is download the Windows Binaries respectively and run it to install on your PC.
Note: you most install “Python” first before installing “wxPython” and “Py2exe”, because they are both python’s extensions/libraries.

Now let’s be sure that all we have installed are working perfectly;
For wxFormBuilder and InnoSetup Compiler, you should see their icons on your desktop or windows start pane. Launch the programs to be sure they are working!

For Python 2.x, wxPython, and Py2exe; you will have to follow the procedures below to verify they are installed properly.

~~ Open command prompt and type python and hit enter. If you got error like on image-1 below, then python is not recognized on your PC. Now do any of Option1 or Option2
~~ Option1: assuming you installed python on this path “C:\Python27” run this code below on the command prompt to fix it automatically (note: if your path is different, replace to the correct path).

[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27", "User" )

~~ Option2: If Option1 above didn’t work for you, add the path manually as follow; open your computer’s “Control Panel” and follow 1-6 as shown on image-2 below (i.e.: Control Panel > System and Security > System > Advanced system settings > Advance > EnvironmentVariable...).
~~ On the window that opens after clicking “EnvironmentVariable...”, select “Path” then click on “Edit” and add your python path starting with semi-column as shown on image-3. Then click on “Ok” three times to apply the path.
~~ If all went well, retyping python on the command prompt will open a Python Shell as shown in image-4 below.

Still on the Python Shell, to test for wxpython and py2exe installations just type import wx and hit enter then type import py2exe and hit enter. If no any message is displayed as in image-5, then you are good to go your installations are in order.



Thanks for reading!

If you can't wait for the next blog post, download the completed tutorial as a .pdf file from this link: http://umaryusuf.com/wxpy/wxPython-gui-tutorial.pdf

No comments:

Post a Comment