Python

  • Python, like Perl, is a language that can be used on the command line (type "python") or as a scripting or programming language.
  • Some resources: Wikipedia; python.org; tutorial; and intro. These last two look pretty helpful.
  • Python has grown so much over the past few years that it now competes with Perl as the dominant preferred language among hackers, webmasters, and scripters.

    Why Python?

  • One major advantage of Python over Perl is that it is much easier to learn; the language looks more like English; and the syntax and structure is a lot more flexible.
  • For example: Loops and conditional statements etc. in Python are all simply indicated by indentations. (Good practice always; necessary for Python.) And you don't have to close loops either -- just end the indentation. Terrific!
  • Another reason that people like Python is that it interacts very nicely with all kinds of other languages and toolkits.
  • Python also handles strings very nicely.
  • Python is also very good at lists and at dictionaries ("hashs" in Perl).

    Examples

  • Here is an example of a Python program that I wrote: radectodeg.py. The input file is taurus.hipp.radec and the output you should get is taurus.hipp.deg.
  • Here's another example.
  • The first example is more of a program, while the second is more of a script (though the line is fuzzy, of course).