Re: [Tutor] how to convert '\xf0' to 0xf0?

2008-12-12 Thread Alan Gauld
What exactly do you want to achieve? I suspect its not what you asked! To convert the character whose hex value of F0 to an integer value of F0 you can use ord() (or just reinterpret the character as a string using the struct module). ord('\xf0') 240 To display the hex value of a character

Re: [Tutor] reading output from a c executable.

2008-12-12 Thread Lie Ryan
On Fri, 12 Dec 2008 03:13:16 -0800, Ravi Kondamuru wrote: Denis, These are 32bit, 64bit counters (essentially numbers). Bob, There are well over 10K counters in the log file that are updated every 5 secs. If a counter1's graph was requested, log will have to be parsed once to get the data

Re: [Tutor] reading output from a c executable.

2008-12-12 Thread Ravi Kondamuru
Denis, These are 32bit, 64bit counters (essentially numbers). Bob, There are well over 10K counters in the log file that are updated every 5 secs. If a counter1's graph was requested, log will have to be parsed once to get the data points. If a user asked for a counter2, now it needs to be

Re: [Tutor] advice on regex matching for dates?

2008-12-12 Thread Lie Ryan
On Thu, 11 Dec 2008 23:38:52 +0100, spir wrote: Serdar Tumgoren a écrit : Hey everyone, I was wondering if there is a way to use the datetime module to check for variations on a month name when performing a regex match? In the script below, I created a regex pattern that checks for dates

Re: [Tutor] reading output from a c executable.

2008-12-12 Thread bob gailer
Ravi Kondamuru wrote: Denis, These are 32bit, 64bit counters (essentially numbers). Bob, There are well over 10K counters in the log file that are updated every 5 secs. If a counter1's graph was requested, log will have to be parsed once to get the data points. If a user asked for a counter2,

Re: [Tutor] reading output from a c executable.

2008-12-12 Thread bob gailer
Ravi Kondamuru wrote: Denis, These are 32bit, 64bit counters (essentially numbers). Bob, There are well over 10K counters in the log file that are updated every 5 secs. If a counter1's graph was requested, log will have to be parsed once to get the data points. If a user asked for a counter2,

Re: [Tutor] regex sub/super patterns ( was:advice on regex matching for dates?)

2008-12-12 Thread spir
Lie Ryan a écrit : I just found a simple, but nice, trick to make regexes less unlegible. Using substrings to represent sub-patterns. E.g. instead of: p = re.compile(r'(?PmonthJanuary|February|March|April|May|June|July| August|September|October|November|December)\s(?Pday\d{1,2}),\s(?Pyear

[Tutor] Ask a class for it's methods

2008-12-12 Thread Shrutarshi Basu
I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. I'm trying to figure out the best way to do this. Since these lists could be very big, and the methods could be rather complex

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Alan Gauld
Shrutarshi Basu technorapt...@gmail.com wrote I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. The easiest way is to call getattr() which will return a reference to the

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Shrutarshi Basu
I normally would use exceptions, because I think exceptions are a great idea. But since the functions may be time-consuming graphics functions and the lists could easily be hundreds of such calls, I don't want the user to sit around for something that might fail. Of course, I'm just starting so my

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Lie Ryan
On Fri, 12 Dec 2008 20:05:23 -0500, Shrutarshi Basu wrote: I normally would use exceptions, because I think exceptions are a great idea. But since the functions may be time-consuming graphics functions and the lists could easily be hundreds of such calls, I don't want the user to sit around

Re: [Tutor] Ask a class for it's methods

2008-12-12 Thread Andreas Kostyrka
On Fri, Dec 12, 2008 at 06:06:35PM -0500, Shrutarshi Basu wrote: I have a list containing strings like : func1[] func2[1,2] func3[blah] I want to turn them into method calls (with numeric or string arguments) on a supplied object. I'm trying to figure out the best way to do this. Since