Home | Contact Us | Log In | Help
  ASP.Net & C#
  Perl and PHP
  Java Scripts
  C and C++
  Ajax Tutorials
  J2ee, J2Me, Java
  Python & Ruby Rail
  Crystal Report
  Cold Fusion & CFML
  Photoshop/Web Designing
  Tools & Utilities
  Sql Server
  Domain Name Registration
  Remotely Hosting
  Web/Server Application
  Hotel Marketing
  Internet and Law
   Search Engine Optimization/SEO
Interview Questions
< 1 2 3 4 5 > Next
Using the Python Interpreter

The Python interpreter is usually installed as /usr/local/bin/python on those machines where it is available; putting /usr/local/bin in your Unix shell's search path makes it possible to start it by typing the command

python to the shell. Since the choice of the directory where the interpreter lives is an installation option, other places are possible; check with your local Python guru or system administrator. (E.g., /usr/local/python is a popular alternative location.)

What is Python?

Python is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.

Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very high level dynamic data types, and dynamic typing. There are interfaces to many system calls and libraries, as well as to various windowing systems (X11, Motif, Tk, Mac, MFC, wxWidgets). New built-in modules are easily written in C or C++. Python is also usable as an extension language for applications that need a programmable interface.

The Python implementation is portable: it runs on many brands of UNIX, on Windows, OS/2, Mac, Amiga, and many other platforms. If your favorite system isn't listed here, it may still be supported, if there's a C compiler for it. Ask around on news:comp.lang.python -- or just try compiling Python yourself.

Installing Python

First you need to download the appropriate file for your computer from http://www.python.org/download. Go to the 2.0 link (or newer) and then get the Windows installer if you use Windows or the rpm or source if you use Unix.

The Windows installer will download to file. The file can then be run by double clicking on the icon that is downloaded. The installation will then proceed.

If you get the Unix source make sure you compile in the Tk extension if you want to use IDLE.

Most versions of GNU/Linux have Python by default or available in their package management system

Python Generators - What are they?

Generators are a cool Python feature that was introduced back in Python 2.2 (as a __future__ import) and became standard in Python 2.3. They are a very neat abstraction that allows you to simplify control flow and in many instances the resulting elegance also leads to much lower memory consumption.

The key to generator functionality lies in the yield keyword. A very simple example of how it works is demonstrated below

A Beginner's Python Tutorial

When CivilizationTM IV (Firaxis Games, published by Take2) was announced, one of the most exciting features was that much of the scripting code will be in python, and the game data in XML. This tutorial attempts to teach you the basics of python programming that you could use with civIV.

Of course, this tutorial is not limited to those who want to play a slow-paced turn-based strategy game. That is what it was written for, but is perfectly useful to any person with no programming knowledge at all, who wants to learn python. But what makes this tutorial unique, is that it is written for beginners, by a beginner.

< 1 2 3 4 5 > Next
  Copyright 2000-2006 © SoloScript.com, All rights reserved.