Home | Contact Us | Log In | Help
HOME NEW LISTING MOST POPULAR HIGHEST RATED SCRIPTS ADD SCRIPT DOWNLOADS FORUM
Tutorials
  ASP.Net & C#
  ASP
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Sap
  CGI
  XML
  Cold Fusion & CFML
  HTML, DHTML & CSS
  Dreamweaver
  FLASH
  Photoshop/Web Designing
  Tools & Utilities
  Oracle/D2K
  Sql Server
  MySql
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
E-Commerce
Interview Questions
Previous< 12 13 14 15 16 17 18 19 20 > Next
PYTHON & RUBY RAIL 16
what is wxPython

wxPython is a toolkit for creating graphical user interfaces (GUI) for the programming language Python. One of the great things about wxPython is the cross platform compatibility. This means that the same code runs on your Linux, Unix, Windows and Mac OSX box without any problems, and it still has a native look to it. You can find more information about wxPython and download it here. And like all good things in this world, it is Open Source.

MySQL and Python

MySQL is a very popular open source  database, it's used in in millions and millions of (web)applications. There is a module for Python that can interface with a MySQL database server, you can obtain it here. The database can be installed on your own machine (local), on a server or on a webserver. If you want to use MySQL for your website, you should make sure that your webhost supports MySQL (very likely) and that they will provide you with the necessary instructions on how to manage it. You will also need the Python CGI module. CGI stands for Common Gateway Interface and it allows you to pass your Python instructions (e.g. using a webform) to a program that is located on the webserver and display the results on a webpage. For this little tutorial we will use a local database. Check out the Search engine tutorial on this website here for more information on how to use MySQL.

Numeric Methods

You can access Numeric arrays just like standard Python lists (using [] brackets), but looping over these arrays using for is not going to be the most efficient. Like many math/array packages Numeric includes quite a few specialized routines to help you take full advantage of Numeric arrays. Depending on what you want to do Numeric may have a specialized method that works quickly and efficently over arrays.

Some simple examples are the Numeric.sum and Numeric.average functions. There is a large selection of Numeric operations that can be quickly accessed by typing "help(Numeric)" at the Python prompt. Here is a brief summary of those functions(shamelessly stolen from Numeric's documentation):

Connect Glade to Python

Now, that's a very nice interface but apart from being nice there is not much you can do with it and this part of the tutorial will tell you how. But first, let's take a look at the required libraries (or modules if you prefer) to run our little app:

  • sys, to be able to use sys.exit(1) terminates Python in midflight if some requirements regarding GTK are not met
  • some functions that use a database to store and retrieve data (in this case DBStuff, it uses MySQLdb)
  • matplotlib, to create them beautiful plots
  • pygtk
The next part shows how the modules are loaded:
Hashes

A Hash is another kind of data storage container. Hashes are similar, conceptually, to dictionaries: they map one object (the key -- for example, a word) to another object (the value -- for example, a word's definition) in a one-to-one relationship.

New Hashes can be created either by instantiating a new object of class Hash (using the Hash.new construct) or by using the curly brace shortcut shown below. When we define a Hash, we must specify each entry using the key => value syntax.

Previous< 12 13 14 15 16 17 18 19 20 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.