How to print SRE_Pattern (regexp object) text for debuggingpurposes? dmtr wrote: I need to print the regexp pattern text (SRE_Pattern object ) for debugging purposes, is there any way to do it gracefully? I've came up with the following hack, but it is rather crude... Is there an official way to get the regexp pattern text? import re, pickle r = re.compile('^... 17 Jun 2010 18:59
max time threads Hi, I'm trying to work with threads and I need your help. This is code: from threading import Thread from Queue import Queue import time import random def test_fun (k,q,t): time.sleep(t) print "hello world from thread " + str(q.get()) + " (sleep time = " + str(t) + " sec.)" q.task_done() qu... 18 Jun 2010 20:10
How to print SRE_Pattern (regexp object) text for debugging purposes? I need to print the regexp pattern text (SRE_Pattern object ) for debugging purposes, is there any way to do it gracefully? I've came up with the following hack, but it is rather crude... Is there an official way to get the regexp pattern text? import re, pickle r = re.compile('^abc$', re.I) r <_sr... 17 Jun 2010 20:05
how to get bit info Hi, I have one byte data and want to know each bit info, I mean how I can know each bit is set or not? TIA ... 19 Jun 2010 05:52
Running a program from another program. I have a program called increment.py as follows: #!/usr/bin/python n = 0 while True: n = int(raw_input(n)) + 1 This is probably very easy to understand, but I want to run this program from another python program. Below is an attempt from... 18 Jun 2010 12:25
The inverse of .join What's the best way to do the inverse operation of the .join function? -- Neil Cerutti ... 18 Jun 2010 12:25
Efficiency/style issues of import <module> vs. from <module> import <name>, ... On Thu, Jun 17, 2010 at 12:58 PM, Stephen Hansen <me+list/python(a)ixokai.io> wrote: On 6/17/10 10:01 AM, Ethan Furman wrote: Stephen Hansen wrote: On 6/17/10 9:12 AM, python(a)bdurham.com wrote: Now, this is all IMHO: the style guide does not define any 'guidelines' on this, except that its oka... 17 Jun 2010 13:24
super() woes (n00b) I cannot get right the super() function: Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22) [GCC 4.4.1] on linux2 Type "copyright", "credits" or "license()" for more information. ==== No Subprocess ==== class P: def __init__(__class__,self): print("I am a member of class P") clas... 18 Jun 2010 14:38
Efficiency/style issues of import <module> vs. from <module>import <name>, ... On 6/17/10 9:12 AM, python(a)bdurham.com wrote: Are there any efficiency or style guidelines regarding the choice of "import <module>" vs. "from <module> import <name>, ..."? There are no legitimate efficiency issues. In theory, module.blah is slightly slower then blah, but that "slightly" is largely irrelevant... 17 Jun 2010 14:30
Serializing functions Some weeks ago, here on the mailing list I read about picloud[1], a python library used for cloud-computing; I was impressed by its simplicity, here is an example: import cloud def square(x): .... return x * x cloud.call(square, 10) cloud.result() 100 So, I tried to figure out how to achieve t... 17 Jun 2010 22:16 |