Wednesday, January 21, 2009

The Python Programming Language

I am finally getting around to saying a word or two about Python (www.python.org). Python deserves mention on a simple computing blog because while the language is not simplistic or limited, the syntax lends itself to expressing your computing ideas in a very natural way. Contrast this with a scripting language like Perl with its myriad special characters and non-intuitive expression.

Python is . . .

  • Object-oriented - Python is fully object oriented complete with classes, operator overloading, and multiple inheritance. Despite this, even a beginner can write useful code in minutes without getting anywhere near object-oriented programming.
  • Portable - Python compiles into portable bytecode which runs on any platform with python installed. The language itself is written in C and compiles on just about any platform including Linux, Mac, Windows, whatever...
  • Easy and fun to use - writing Python is a pleasure! You just sit down and write and out comes useful code.
How can you use Python?
  • Applications - complete toolkits exist for developing GUI applications that run on multiple platforms. These include wxPython and TKinter.
  • Prototyping - because you can write useful code in minutes, Python is great for proving concepts at the outset then porting the code to a compiled language for production.
  • Internet scripting - built in internet modules let you easily retrieve and parse HTML (web scraping), move files with FTP and communicate with email using SMTP and POP protocols. Python is the language behind entire web publishing frameworks, such as Django. Or, you can write simple CGI scripts that add interactivity to your web site.
Really the question is what can't you use Python for?

P.S. - Python includes a built-in module for another simple computing winner, SQLite!

No comments: