Regular expression issue

2006-07-19 Thread dmbkiwi
I'm trying to parse a line of html as follows: 101.120:( KPA (-) Snow on Ground)0 however, sometimes it looks like this: N/A Snow on Ground)0 I want to get either the numerical value 101.120 (which could be a different number depending on the data that's been fed into the page, or in terms o

Re: PyQt issue

2006-03-03 Thread dmbkiwi
Hangs head in shame. Slinks off with tail between legs. Thanks -- http://mail.python.org/mailman/listinfo/python-list

PyQt issue

2006-03-03 Thread dmbkiwi
I'm trying to write a simple dialog with PyQt. Ive got this code as one of the slots: def setFixed(self): if len(str(self.fixed_label.displayText())) == 0: QMessageBox.critical(self, "Label Missing", "You must enter a label.") else: print str(self.fixed

Re: dateutil and dates before today

2006-02-26 Thread dmbkiwi
I'll answer my own post. If you don't specify dtstart, it defaults to datetime.today(). Therefore, there are no instances before today. Specify dtstart as a historic date, and it works on any dates after dtstart. Wish I'd engaged brain before posting. Matt -- http://mail.python.org/mailman/li

dateutil and dates before today

2006-02-26 Thread dmbkiwi
I'm using the dateutil module from http://labix.org/python-dateutil. Am I right in thinking that the rrules module doesn't acknowledge days before today? An example of the issue: >>> rule_temp = rrule(YEARLY,bymonth=1,bymonthday=1) >>> print rule_temp.between(datetime(2006,12,1),datetime(2007,1,

cookielib extracting a cookie value as a string

2006-01-27 Thread dmbkiwi
I am trying to extract the value of a cookie from a CookieJar() object using cookielib. I have a CookieJar() object called cj. Printing cj gives: <_LWPCookieJar.LWPCookieJar[, ]> But i can't work out how to extract the value. If I use make_cookies(), I get: [Cookie(version=0, name='GA3T', val

Logging into a website using urllib2

2006-01-27 Thread dmbkiwi
I've been using urllib2 to try and automate logging into the google adsense page. I want to download the csv report files, so that I can do some analysis of them. However, I don't really know how web forms work, and the examples on the python.org/doc site aren't really helpful. I've found workin

Re: kdialog and unicode

2005-04-27 Thread dmbkiwi
John Ridley wrote: > dmbkiwi wrote: > > > I'm trying to get python, unicode and kdialog to play nicely > together. > > This is a linux machine, and kdialog is a way to generate dialog > boxes in > > kde with which users can interact (for example input text),

Re: kdialog and unicode

2005-04-27 Thread dmbkiwi
John Machin wrote: > On 26 Apr 2005 19:16:25 -0700, [EMAIL PROTECTED] wrote: > > > > >John Machin wrote: > >> On 26 Apr 2005 13:39:26 -0700, [EMAIL PROTECTED] (dumbkiwi) wrote: > >> > >> >Peter Otten <[EMAIL PROTECTED]> wrote in message > >news:<[EMAIL PROTECTED]>... > >> >> Dumbkiwi wrote: > >> >

Re: kdialog and unicode

2005-04-26 Thread dmbkiwi
John Machin wrote: > On 26 Apr 2005 13:39:26 -0700, [EMAIL PROTECTED] (dumbkiwi) wrote: > > >Peter Otten <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > >> Dumbkiwi wrote: > >> > >> >> Just encode the data in the target encoding before passing it to > >> >> os.popen(): > > > > >

Re: kdialog and unicode

2005-04-26 Thread dmbkiwi
Peter Otten wrote: > dumbkiwi wrote: > > > I'd be interested to see what your default encoding is, > > ascii > > > and why your output was different. > > If only I knew. > > > Anyway, from your post, I've done some more digging, and found the > > command: > > > > sys.setappdefaultencoding() > > Th