python category archive
More fun with Python and regular expressions. Following up on a previous post, I wanted to share a little test regex function I wrote in Python to help me as I work through the regular expression book.
I’m mostly working at the interactive prompt and had been running commands from Python re (the regex module) as I experimented with different regular expressions. This was good as I spent time in help(re) and built up some muscle memory for Python regex functions, but it was becoming repetitious to keep typing the commands for analyzing the results of a match. Once I started learning about writing functions in Python, I realized it was time to enhance my …
by Scott Carpenter on 29 March 2008 at 10:34 am
Permalink |
Comments (2) | filed under code, python, regex
|
I don’t want to go all 7 Habits of Highly Effective People on you, but I’ll say this: I think it’s good to have goals and to work towards your goals.
I like this quote, which I’ve seen attributed to Zig Ziglar:
“Most people fail to reach their goals not because their plans are too simple or too complicated. Most people don’t reach their goals because they’re not committed and willing to follow their plans.”
I think that’s very true. There are so many things I haven’t done because I didn’t follow through on a plan.
What this means for you, loyal reader, is that one of the reasons I’m not accomplishing the goal of writing more for the web site (including a write-up of …
by Scott Carpenter on 23 March 2008 at 10:33 pm
Permalink |
Comments (3) | filed under books, python, regex
|
Last month I mentioned I wanted to import a bunch of notes from my old PIM into Tomboy, but expected a lot of copying and pasting busywork since I didn’t know how to do a mass import. Fortunately, a real live Tomboy developer dropped by to clue me in on the D-Bus interface with which I could use Python to script something up. (Thanks, Sandy!)
Having a starting point, my first search turned up a great Ars Technica article by Ryan Paul that gave me all the information I needed: “Using the Tomboy D-Bus interface.” Read it for an explanation of what DBus is about, and some good tips for using Tomboy’s API.
With this post I’m just going to focus on …
by Scott Carpenter on 23 February 2008 at 4:11 pm
Permalink |
Comments (0) | filed under python, tomboy
|
After writing last week about how I missed the Windows-only Tortoise(CVS|SVN) in GNU/Linux and sharing my simple scripts for running Subversion commands from Nautilus, I found Nautilus Svn by Jason Field, an Extension written in Python. (And available under the GPL v2.) It’s very nice, and adds (among other things) a major feature that you want in a graphical source control tool integrated with your file manager: visual cues of file status via icons. It uses Nautilus’s Emblems:
Those are what I have by default with the “Human” theme in Ubuntu 7.04/Feisty Fawn. So what are emblems? I’ve previously noticed the house emblem on my home dir and the lock emblem on system directories (hard to miss them). There is also a tab in file …
by Scott Carpenter on 6 November 2007 at 8:40 pm
Permalink |
Comments (4) | filed under gnome, graphics, python, svn
|