First  |  Prev |  Next  |  Last
Pages: 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230
Odd json encoding erro
I get this exception when decoding a certain JSON string: 'ascii' codec can't encode character u'\u2019' in position 8: ordinal not in range(128) The JSON data in question: http://mlb.com/lookup/json/named.player_info.bam?sport_code=%27mlb%27&player_id=%27489002%27 It's in the 'high_school' key. Is there s... 15 Dec 2009 18:56
accessing gmail
I'm having trouble getting to gmail messages. I can access my googlemail account through imap with no problems, that's an old one. The problem is trying to get to my current gmail account, which is actually tony(a)tonyburrows.com. The page shows up as mail.google.com/a/tonyburrows.com and I can't see how to ge... 16 Dec 2009 05:47
Interesting things of 'getattr' and 'setattr'
I don't know it is a feature, or implement detail: class C(object): pass .... c = C() setattr(c, ' ', 3) getattr(c, ' ') 3 setattr(c, 'with blank', 4) getattr(c, 'with blank') 4 getattr / setattr seems treat any string as attribute name. ... 15 Dec 2009 08:56
multiprocessing module
I have a function that makes two subprocess.Popen() calls on a file. I have 8 cores. I need 8 instances of that function running in parallel at any given time till all the files are worked on. Can the multiprocessing module do this? If so, whats the best method? A technical overview of how the multiprocessing m... 1 Jan 2010 03:20
multiprocessing callbacks?
Hey, everyone - I'm trying to use multiprocessing to create a process pool similar to multiprocessing.Pool, except that it works across multiple hosts. For various reasons, I would like the result of async_apply() to return a Twisted Deferred object. My first attempt at the implementation is: class Deferred... 14 Dec 2009 19:56
Seek support for new slice syntax PEP.
Just as sets may now be written as {3,'hi'}, I propose that slices should be available using [start:end] syntax. Following example comes from projecteuler.net problem 166. The Numeric community would also like this, as would the general python user. The slice notation would require one ":" between the brackets t... 19 Dec 2009 11:36
What is the differences between tkinter in windows and Tkinter in the other platform?
Hidekazu IWAKI wrote: Hi, I'm hidekazu. I'm making a Tk application with python. In the below code, the class App was inherited from Tkinter.Tk and the __init__ method calls Tk's constructor with `super` method. In windows, this code is valid (but, Tkinter -> tkinter). Why does this code hap... 14 Dec 2009 10:59
Introduction to Python: Change of Dates
Please note that the dates of our upcoming "Introduction to Python" three-day class have been changed to avoid the federal holiday on Martin Luther King Day. The class will now run from January 19-21. Details at http://hwebpyintnyc01.eventbrite.com/ regards Steve -- Steve Holden +1 571 484 6... 13 Dec 2009 21:59
unable to read the __main__ namespace
I'm learning Python, and I am very fond of it. Using Python 2.6 I am able to list all the names in a class namespace: class abc: pass abc.a1=7 abc.a2='Text' print abc.__dict__.keys() a) However, I do not know how to read the __main__ namespace print __main__.__dict__.keys() # Just does not work ... 13 Dec 2009 14:17
Dangerous behavior of list(generator)
In most cases, `list(generator)` works as expected. Thus, `list(<generator expression>)` is generally equivalent to `[<generator expression>]`. Here's a minimal case where this equivalence breaks, causing a serious and hard-to-detect bug in a program: def sit(): raise StopIteration() ... [f() f... 2 Jan 2010 16:05
First  |  Prev |  Next  |  Last
Pages: 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230