I'm looking for something like Tcl's [clock scan] command which parses human-readable time strings such as: % clock scan "5 minutes ago" 1246925569 % clock scan "tomorrow 12:00" 1246993200 % clock scan "today + 1 fortnight" 1248135628 Does any such package exist for Python? Many TIA!... more »
[link] simple_markup2.py [link] util2.py The two above files are from chapter 20 of the Apress book "Beginning Python ...the book "simple_markup2.py < test_input.txt > test_output.html i get the following error every time.... more »
I am trying to write a simple little program to do some elementary stock market analysis. I read lines, send each line to a function and then the function returns a date which serves as a key to a dictionary. Each time a date is returned I want to increment the value associated with that date. The function seems to be working properly.... more »
HI, Im trying to parse a bands myspace page and get the total number of plays for their songs. e.g. [link] The problem is that I cannot use urllib2 as the "Total plays" string does not appear in the page source. Any idea of ways around this? Thanks, O
Hello! I have been thinking about how write exception safe constructors in Python. By exception safe I mean a constructor that does not leak resources when an exception is raised within it. The following is an example of one possible way to do it: class Foo(object): def __init__(self, name, fail=False):... more »
Robert DeBerry / The Mat-Su Valley Frontiersman / AP When Alaska Governor Sarah Palin announced her intention to resign on July 3, many assumed there must be a looming scandal. more on [link]
Robert McNamara, the architect of the Vietnam war who later made a public reversal on the conflict and said it should never have been fought, died today. more on [link]
MOSCOW (AP) - Some prominent Russian human rights activists said Monday they fear they won't be able to talk frankly and in detail about Russia's checkered rights record when they meet briefly with President Barack Obama during the summit. more on [link]