A Byte of Python
“A Byte of Python ist ein freies Python-Buch/Python-Tutorial und jetzt in der Version 1.20 erschienen.”
“A Byte of Python ist ein freies Python-Buch/Python-Tutorial und jetzt in der Version 1.20 erschienen.”
“An Introduction to Jython. Diese Folien zeigen an Hand von Beispielen auf, wie man etwas in Pure Java und wie man es in Jython programmiert. Lesenswert und lehrreich. [Lambda the Ultimate - The Programming Languages Weblog - Join today!] “
“
pypod 0.2 »has been released. pypod is a Python library and script for managing iPod metadata and music files.« [Daily Python-URL! (from the Secret Labs)]“
“The universal database is just one example of the kind of next-generation platform service that will be used primarily through managed interfaces. As operating systems consolidate around managed interfaces — to data, to middleware, to graphics — they’re going to tend to prefer the Java and .NET and Mono VMs over the Perl, Python, or PHP VMs. But the agility of the dynamic languages, and the collaborative energy of their open-source communities, will matter more than ever. Injecting these qualities into the mainstream VMs is something I’ve always thought was crucial.”
Permalink Comments off
In diesem Aufsatz hatte ich erklärt, wie ich mir einen Editor (in meinem Falle BBEdit) als User Interface für eine Blogsoftware vorstelle. Nur, wie funktioniert das eigentlich praktisch?
Meine Lösung nutzte zwei Scriptsprachen. Einmal AppleScript, um via AppleEvents Zugriff auf den Inhalt des Editorfensters zu haben (das geht angeblich auch mit MacPython, nur leider habe ich bis heute nicht herausbekommen, wie…) und dann Python, um die ganze Logik der Generierung eines Weblogeintrages und dem Upload zum Weblog zu erledigen.
Zuerst zu AppleScript. Hier reicht ein simpler Dreizeiler und der magische Befehl do shell script:
tell application "BBEdit"
copy contents of window 1 to speicher
copy contents of (do shell script
" /Users/jorgkantel/scripte/echofrombbedit.py '"
& speicher & "'") to result
display dialog result
end tell
window 1 scheint nach meinen Tests tatsächlich immer das frontmost window zu sein, so daß der komplette Inhalt des Fensters, das im Vordergrund ist, an das Python Script übertragen wird.
Ja, und das Python Script, das bekommt den Text und kann nun damit machen, was es will. ;o). Das Einfachste ist, es gibt eine Echo zurück:
#!usr/bin/python def echoFromBBEdit (s): print s try: import sys s = sys.argv[1] except: s = "Parameter nicht definiert!" echoFromBBEdit(s)
Dieses Echo wird dann einfach wieder an AppleScript zurückgegeben (was in diesem Fall nicht unbedingt notwendig ist, aber zeigt, wie es geht).
Wichtig ist, daß mittels chmod +x scriptname der executable Flag gesetzt wird, damit das Betriebssystem daß Script auch ausführen kann. Und da Python bei Mac OS X zum Lieferumfang gehört, sind keine zusätzlichen Installationen erforderlich.
Fredrik Lundh: »The WCK Graph package is a simple plotting package for the Widget Construction Kit. The Widget Construction Kit is an extension API that allows you to implement custom widgets in pure Python. There is an implementation for Tkinter.« [Daily Python-URL! (from the Secret Labs)] [Der Schockwellenreiter]
Fredrik Lundh: »The WCK Graph package is a simple plotting package for the Widget Construction Kit. The Widget Construction Kit is an extension API that allows you to implement custom widgets in pure Python. There is an implementation for Tkinter.« [Daily Python-URL! (from the Secret Labs)] [Der Schockwellenreiter]
wxPython 2.5.1.5 ist draußen. Und es gibt jetzt auch einen Installer für Panther. [Daily Python-URL! (from the Secret Labs)] [Der Schockwellenreiter]
“
Hugo (aka Georg Bauer) hat wieder zugeschlagen: Programming by contract for web services. »The CVS version of Toolserver Framework for Python has an experimental addition for programming-by-contract concepts for webservices. The idea is to get better spec’ed remote APIs that are much more robust to abuse and much more stable when running as a service.« [Daily Python-URL! (from the Secret Labs)] “
[full article at Der Schockwellenreiter]
“
Jon Udell: Lightweight XML search servers, Part 2. » In last month’s installment I showed a simple search service that uses libxslt to reduce a file of XML content (my weblog writing) to just the elements matching an XPath expression. This month’s challenge was to scale up to a database-backed implementation using Berkeley DB XML. Since my own XML corpus doesn’t present much of a challenge to DB XML, I also decided to include all of the 200+ blogs I read. This proved interesting because only a handful of them provide well-formed XHTML content. So before I dive into the details of the DB XML implementation, here’s the rundown on how I built an RSS aggregator that renders feeds as well-formed XHTML.« Programmiersprache ist Python. (Was den sonst? ;o)) Ausdrucken! [Daily Python-URL! (from the Secret Labs)]“ [Der Schockwellenreiter]