First  |  Prev |  Next  |  Last
Pages: 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
Code redundancy
Hi, During my Python (3.1) programming I often find myself having to repeat code such as... class1.attr1 = 1 class1.attr2 = 2 class1.attr3 = 3 class1.attr4 = 4 etc. Is there any way to achieve the same result without having to repeat the class1 prefix? Before Python my previous main language was Visua... 23 Apr 2010 20:49
Python DXF import library?
Is anyone aware of a Python DXF import library? I think I remember seeing converters but so far I haven't found a library. I need to write a tool that reads DXFs so I'm not yet sure if a converter would be of any use. Thanks ... 23 Apr 2010 20:48
urllib2.urlopen taking way too much time
handler = urllib2.urlopen(req) is taking way too much time to retrieve the URL. The same code using sockets in PHP doesn't delay this long. I had 'Authorization':'Basic ' + base64.b64encode("username:password") in my header though. [ I didnt use HTTPPasswordMgr & HTTPPasswordMgrWithDefaultRealm because I was unabl... 20 Apr 2010 15:48
[pylint] why pylint wants only capitals identifiers?
i have this code def example(a): return lambda b: a+b+1 fun = example(10) k_1 = fun(7) .... and pylint tells me [...] C: 4: Invalid name "fun" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$) C: 5: Invalid name "k_1" (should match (([A-Z_][A-Z0-9_]*)|(__.*__))$) [...] afaict, [A-Z_][A-Z0-9_]* id... 20 Apr 2010 15:48
copy some files from IE temporary internet files
On 19/04/2010 10:49, CHEN Guang wrote: Hi friends, I want to program Python to copy some video files (.flv) from the IE folder "temporary internet files", but os.listdir('C:\\Documents and Settings\\Administrator\\Local Settings\\Temporary Internet Files') seemed unable to find any video file (althoug... 20 Apr 2010 15:48
default value in list comprehension
Hi, just a quick one, Is it possible to achieve a default value in a list comprehension where the if-clause is false? Ie, something similar to: [ a for a in b if something(a) else 'default' ] the idea being that, rather than skip a value if the if-clause is false, to place a default value at that posit... 20 Apr 2010 15:49
Tkinter scrollbar background color doesn't work
On Apr 19, 6:35 pm, KL <klu1...(a)gmail.com> wrote: Tkinter scrollbar widget's "background" and "relief" options seem not work. The below is the codes I tried and the python/tk information: =================== ActivePython 2.6.4.8 (ActiveState Software Inc.) based on Python 2.6.4 (r264:75706, Nov ... 20 Apr 2010 15:48
Python 2.6 SSL module: Fails on key file error, with Errno336265225, without a key file.
Le Sun, 18 Apr 2010 22:37:30 -0700, John Nagle a écrit : The cert file is the same PEM file I use with M2Crypto, and it's derived from Firefox's cert file. Why am I getting a "private key" related error? I'm not submitting a keyfile, just a cert file. I'm not an expert but this is what the SSL d... 20 Apr 2010 15:48
ctypes return char array with null chars
Hi all, I am passing a ctypes struct byref to a dll. When I get the struct back, it looks like the char array in the struct was truncated at the first null char. It should be 192 bytes long, but I know the 3rd through 6th byte are null chars and the array was truncated right before byte 3. Is there any way to... 20 Apr 2010 15:49
dict.keys() and dict.values() are always the same order, is it?
Cameron Simpson <c...(a)zip.com.au> wrote:   If items(), keys(), values(), iteritems(), iterkeys(), and   itervalues() are called with no intervening modifications to the   dictionary, the lists will directly correspond. This allows the   creation of (value, key) pairs using zip(): pairs = zip(d.values(), ... 20 Apr 2010 15:48
First  |  Prev |  Next  |  Last
Pages: 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151