• home
  • forum
  • my
  • kt
  • download
  • Python Babysteps Tutorial

    Author: 2007-08-25 10:23:51 From:

    If you have never programmed before in your life, then do I have the perfect programming language for you. It's called Python, and it is easy to learn, flexible, and loaded with capabilities that you never thought would be so easy to use. Imagine your thrill when you write a complete program in just a few lines!

    If you have spent years programming Perl, and are just about sick of all of the wierd little context dependencies ("My function does this when you hand it a single object, and that when you hand it a list, unless you are assigning the result to a list, in which case it does this other thing"), then do I have the perfect language for you. It's called Python, it has clear, unambigous syntax, and it is simple to create your own modules and objects. Imagine your thrill when you write a complete program in just a few lines, and somebody else can read it!

    This is a tutorial to help the non-programmer learn the basics of using Python. When you are done with it, you will be ready to learn this new language, and have no problems figuring out where to find the information you need to go farther.

    Experienced programmers may get some small value out of this, too, but you will probably tire quickly. I am aiming for simplicity, rather than rigid accuracy. There is always the official Python tutorial to provide an introduction for you veterans.

    If anybody has any suggestions or comments about this tutorial, please send me some mail and let me know!

    I hope you enjoy this!

    Brian

    Installing Python

    Before you can use Python, you need to get Python.

    Which Version of Python?

    There are two versions1 of Python available for download:

    1. ActiveState's ActivePython
    2. The official release of Python 2.4.3

    Which one you install is mostly a personal choice. The language itself is the same, regardless of where you download it from. The main differences are the type of support you can get, and the tools that they come packaged with.

    The ActiveState version has the benefit of being from a real, live company. You can purchase support and take advantage of the fact that it comes from a single source. It (the Windows version, anyways) comes with the excellent PythonWin program for developing your Python programs in a Windows environment. Because of the support and the Windows-friendly tools, ActivePython may be the best choice for business users.

    Python 2.4, on the other hand, is the "official" version. It comes with a standard set of tools which are available on every platform that Python can support. Instead of PythonWin2, Python 2.4 comes with IDLE: a cross-platform graphical environment for developing your Python programs. IDLE works pretty much the same for you whether you are sitting in front of a Windows or a Linux machine. It's the version that I'm using for the tutorial, so maybe that has some bearing on your decision.

    1 Okay, there is also Jython and IronPython, but both of these are for special platforms - Java and .NET, respectively. As such, they have more specific requirements than I am interested in covering here. Don't let that stop you from feeling bold, though!

    2 PythonWin is still available to you as part of the win32all package, but you need to download and install it separately from your Python distribution.

    discuss this topic to forum

    relation tutorial

    No relevant information

    Category

      Development (6)
      Introduction to Python (5)
      Miscellaneous (4)
      Searching (2)
      Web Fetching (5)
      XML and Python (0)

    New

    Hot