It Fits Your Brain: the Ninth Annual International Python Conference
2001 is also the year of Zope Alternatives. My favorite discovery was Webware. Chuck Esterbrook developed this modular web application server out of frustration with the monolithic nature of Zope (see Chuck's presentation for an overview). The main component is WebKit, which allows Python packages to be servlets. Here's a minimum servlet:
from WebKit.Page import Page class index(Page): def title(self): # This will go into the HTML <TITLE> tag. return "Important Message" def writeBody(self): self.writeln(" This web site is not here yet.")
You can call this "index.py" and invoke it in the browser as index.py, index or even as the directory. The file must contain a class with the same name as the file, and this class is normally a subclass of Page. CGI parameters and cookies are as simple as:
req = self.request() fname = req.field('fname') bgcolor = req.cookie('bgcolor', '#FFFFFF') # With default.
You even get a session object for free:
sess = self.session() name = sess.value('name') sess.setValue('x', 5)
The application caches servlet instances for later reuse. It interacts with Apache or AOLserver via a CGI interface or a web server module (e.g., mod_python). Two other plug-ins deserve mention. Python Server Pages is for those who prefer embedding Python commands in HTML files à la ASP or PHP. MiddleKit is an object-oriented intermediary for database access.
I wish I had space to discuss some of the other talks. Eric Raymond presented CML2, his Linux kernel configuration system. Others talked about internationalizing Mailman using GNU gettext, weak references, writing Microsoft .NET programs in Python, etc. One notable module mentioned is pyperl), which allows your script to call Perl functions.
In the hallway were vendor exhibits, including ActiveState's Python Cookbook (a free interactive FAQ), and the Toilet Paper display.
Toilet Paper is an automated water closet. No, there wasn't a loo in the hallway, just a diagram of the privy. A 486 computer running Slackware sits alongside the porcelain bowl. It detects visitors outside via a motion detector and has sensors for toilet seat position, light switch position, etc., and then plays appropriate music for each state. It fetches selected web pages, extracts the headlines and displays them on an LCD screen. Toilet also has an external web interface to request songs, report on its usage history (scary) and send messages to the LCD screen.
Bruce Eckel is the person who invented the "Python Fits Your Brain" slogan as well as last year's "Life is Better Without Braces". He's also a well-known C++ and Java design consultant. In his closing keynote, Bruce presented the top ten reasons why he loves Python:(See the Powerpoint slides from Bruce's presentation.)
10. Reduced clutter.
8. It doesn't value performance over my productivity.
7. It doesn't treat me like I'm stupid. Java insists operator overloading is bad because you can make ugly code with it. Bruce observes, "And we all know there's no ugly Java code out there."
6. I don't have to wait forever for a full implementation of the language.
5. It doesn't make assumptions about how we discover errors.
4. Marketing people are not involved in it (yet).
3. I don't have to type so much. But what I do type is the right typing.
2. My guesses are usually right.
1. Python helps me focus on my concepts rather than on fighting with the language.
His idea for the next Python slogan? "No warranty, not fit for any particular purpose." We'll see about that next year.
Conference proceedings and slides have been posted to the Python9 web site.
Mike Orr writes web applications at SSC, edits Linux Gazette and does other sysadmin stuff. He doesn't usually write articles, but he makes an exception for Python because it's so cool.
Special Reports: DevOps
Have projects in development that need help? Have a great development operation in place that can ALWAYS be better? Regardless of where you are in your DevOps process, Linux Journal can help!
With deep focus on Collaborative Development, Continuous Testing and Release & Deployment, we offer here the DEFINITIVE DevOps for Dummies, a mobile Application Development Primer, advice & help from the experts, plus a host of other books, videos, podcasts and more. All free with a quick, one-time registration. Start browsing now...
- Vigilante Malware
- Disney's Linux Light Bulbs (Not a "Luxo Jr." Reboot)
- Dealing with Boundary Issues
- Libreboot on an X60, Part I: the Setup
- Bluetooth Hacks
- System Status as SMS Text Messages
- Vagrant Simplified
- October 2015 Video Preview
- October 2015 Issue of Linux Journal: Raspberry Pi
- Non-Linux FOSS: Code Your Way To Victory!