Archive | Python

The object-oriented scripting language

Dabo rocks!

I’ve mentioned it before, but the dabo project rocks! dabo is intended to be a cross-platform (Mac/Linux/Windows/Everywhere) rich-client application (like FoxPro 2.5 before MS bought it) with the rich-client experience (grids, list boxes, checkboxes, pageframes, menus, multiple forms) in the appropriate widget-set for each OS. It supports a slew of backend data sources (MySQL, PostgreSQL, MSSQL, Oracle, more) and is designed with a similar architecture (UI-BizObjects-Data) to many of the FoxPro frameworks. Best of all, it’s written in Python and available under an Open Source license.

I’ve spent a couple days downloading the source, watching the excellent screencast tutorials, browing the extensive mailing list archives and wiki, running the demos, generating an app with the App Wizard and reading the code. I’ve got an existing LAMP application that would benefit from a rich-client component with reporting capabilities, and dabo looks like a good choice. Hope to blog my progress as I get into it.

SQLAlchemy 0.30 released

Over at O'Reilly's ONLamp site, Jeremy Jones noted last week the release of SQLAlchemy 0.30. Lloyd Kvam had mentioned in his TurboGears presentation last month that TurboGears was going to be expanding their current support for Object-Relational Mapping (ORM) tools to include SQLAlchemy. I'm looking forward to playing around with this and trying to grok the difference beween ORMs and cursors and views. So much to learn…

SQLAlchemy 0,30 released

Over at O'Reilly's ONLamp site, Jeremy Jones noted last week the release of SQLAlchemy 0.30. Lloyd Kvam had mentioned in his TurboGears presentation last month that TurboGears was going to be expanding their current support for Object-Relational Mapping (ORM) tools to include SQLAlchemy. I'm looking forward to playing around with this and trying to grok the difference beween ORMs and cursors and views. So much to learn…

PySIG: 26-Oct-2006 SciTE, meld, subversion, lambda expressions

Bill Sconce announces:

The monthly meeting of PySIG, the New Hampshire Python Special Interest Group, happens on the fourth Thursday of the month, starting at 7:00 PM. Beginners' session starts at 6:30 PM. Bring a Python question!

At this meeting we'll begin the often-requested “Python development
series”, with the specific topics of source-code differencing (using
meld – an excellent development tool in its own right, written in
Python!), how to integrate tools such as meld into the SciTE editor.
In other words, one way to start complementing and moving beyond the
interactive Python window. Time permitting, we'll demonstrate similar
integration of revision control: Subversion checkins and Subversion
diffs. Presented by Bill Sconce (recovering Eclipse user).

Kent's Korner (Module of the Month) will be lambda expressions, hosted
this month by Mr. Python, Lloyd Kvam of Venix Corp.

The full announcement can be found here

Python Special Interest Group: September 28: byte codes and TurboGears

Bill Sconce posts the news for next Thursdays Python Special Interest Group meeting in Manchester:

PySIG — New Hampshire Python Special Interest Group
Amoskeag Business Incubator, Manchester, NH
28 September 2006 (4th Thursday) 7:00 PM

PySIG meetings are seminar-style, hands on. Laptop-friendly: 'Net access, wired + wireless. Python questions, war stories, examples always welcome.Everyone is welcome. Free of charge. Free of braces.

7:00 PM: Introductions –Bill & Ted & Alex, Milk & Cookies –Ben, Janet

7:10 PM: Happenings & AnnouncementsL Python 2.5 Released! Hosstraders 5-6 October, Hopkinton…

7:15 PM: Anyone's question(s) about Python, Python Module of the Month, Favorite-Python-Gotcha contest, Topics for future meetings…

7:30 PM: Bytecode Disassembly & Reassembly, presented by Bill Sconce, In Spec, Inc., Milford NH

Bill: “An August announcement on python-announce-list caught my eye — a bytecode assembler/dissassembler for Python. Because I spent one of my former lives as project leader for a bytecode/stack-pseudomachine, JIT-compiled, commercial language I thought it'd be fun and instructive to poke into Python's pseudomachine. It was and is. This easy-to-use tool makes it easy for anyone to get a start looking at Python internals.”

Bill Sconce is co-founder and chief cookie-procurer at PySIG, teaches Python, and writes in Python as often as he can.

8:10 PM: TurboGears, presented by Lloyd Kvam, Venix Corp, Lebanon NH

Lloyd: “I am impressed with the TurboGears (TG) approach to combining data and templates. They have a 20 minute tutorial that took me an hour – I insist on trying to understand how the magic is done. TG has a very ingenious use of decorators to link templates and data.

“The result is very different from Myghty which is much more like PHP with lots of snippets that get combined any which way you like.

“I am not sure I really understand all of the tradeoffs between the TG and Myghty approaches. That could lead to some interesting discussion.”

Lloyd Kvam is a charter member of PySIG and has given a number of Python tutorials at PySIG and elsewhere.

Python Reads SourceSafe

Picking up an example presented in 1998 for using COM Automation on SourceSafe from Visual FoxPro, I created the same example in Python with just as little code. Using Mark Hammond's Win32All to supply the Win32 and COM support, the following code will list all the files in a particular SourceSafe project and their version numbers.


import win32com.client

SSafe=win32com.client.Dispatch("SourceSafe")
SSafe.Open("c:\Projects\VSSPath\srcsafe.ini","troche","secret")

Root=SSafe.VSSItem("$/MyClient/MyProject")
VSSItems=Root.Items

print VSSItems.Count
for loNode in VSSItems:
	print loNode.Name, loNode.VersionNumber

Subversion new version, SourceSafe conversion

OSNews reports Subversion 1.4.0 Released. “This is a feature release of Subversion [Updated link], featuring BDB 4.4 and repository auto-recovery support, a new tool for synchronizing repositories (svnsync), major speed enhancements in the versioned filesystem and the working copy, and of course the usual host of bugfixes and minor enhancements. Additionally, check this article on how to Set up Subversion and websvn on Debian.”

Good timing! I've been using subversion for the past year on a web development project with another (remote) developer, and have enjoyed the power and flexibility of the tool, as well as some of the cool add-ons, clients and scriptability.

Now, it's time to consider moving existing projects out of Visual SourceSafe and into subversion. The folks at Pumacode offer an vss2svn tool that runs as a native Windows executable, written in Perl and C, with the source available under an open license. Pumacode tried an interesting tactic to convert the VSS repositories: rather than interogate the VSS binary to retrieve files, it reads the repository files directly and interprets the results from there. There are some advantages where older versions might be corrupted, or to retrieve files flagged as deleted, which they say VSS will not allow.

On a 2 Ghz Pentium-M with a gig of RAM, it took about 2 hours to process my current VSS repository, which consists of forty thousand files and around 1.4 Gb of disk space. (The authors of vss2svn caution that it's better to convert the entire repository than to risk further corruption by pruning it first; leave that task to subversion post conversion.) This generated a dump file of 850+ Mb. Transferring that to the Linux box with a new repository took a few minutes, and loading the data about 20 minutes. Using RapidSVN from the Windows box, I was able to browse the subversion repository and confirm that files and folders and log history comments look about right. I'll confirm by checking out projects of interest and diff'ing them against the current development copies.

I had anticipated a different tack, using COM Automation to drive VSS, as I described in Essential SourceSafe. As a learning project, I had proposed using Python to browse the repository via COM Automation and use the excellent Python-svn bindings to migrate portions of a VSS repository to subversion. I still plan to try that, and to compare-and-contrast the results between the two techniques, while I learn a little more Python.

There is no one best way

Declarations of a One True Way to Python Web Frameworks has lead to lots of kickback. A few samples from Daily Python-URL! (from the Secret Labs):

  • [Floris Bruynooghe] Python web frameworks
  • [online.effbot.org: Fredrik Lundh] he has given us… his shoe!
  • [Groovie] Notes on the Python Web Framework Pronouncement

The consensus seems to be that not much has really changed following the “pronouncement.” No one is in charge, and choice is a good thing. The TurboGears folks will keep trying a little harder, now that they're officially #2, everyone else will try a little harder to unseat them.

What will be good to see implemented would be a comparison chart of the many products. The FoxPro Wiki does a great job of this for VFP Frameworks, and CMS Matrix does a good job on content management systems. This would be a great service to the community.

Django the #1 choice for Python's Benevolent Dictator For Life

Over at Blue Sky On Mars: Kevin Dangoor, one of the lead developers for the TurboGears Python web framework posts, “There can't be only one.”

“I guess I'd better give up now. Guido announced at SciPy that Django is the standard web framework for Python. How's that for a first two sentences of a blog post? ”

“Always there are two, a master and an apprentice.” Master Yoda says.

Neo claims, “It's about choice. Free will is the one thing that can't be factored out of the system.” Free will mustn't be factored out of the system. The Joy of Branching is that someone else will go off and try something else, take a different direction, chose the Road Less Taken. And that will make all the difference.

No one size fits all. Sometimes you just need a little snippet, a tweak, of inline python code like you can do with Myghty. Other times, you need a big, honking uber-reliable message-passing system with scalability, redundancy, failover, point-in-time recovery and full BuzzTerm 2.0 compliance. Sometimes you just want to toss together a quick-and-dirty web site for a friend and the first app you come across with a README small enough to take in in one glance is the choice.

There's always room for more than one. Fight for choice.

link via Daily Python-URL! (from the Secret Labs)

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.