Re: A problem about ipython

2011-04-02 Thread Vincent Ren
On Apr 2, 1:16 am, Robert Kern wrote: > > In order to support pickling and its %run feature, IPython makes a fake > __main__ > module. It looks like profile.run() explicitly imports __main__ to try to run > the statement there. Honestly, it's been a thorn in our side for a long time, > but it's a

Re: A problem about ipython

2011-04-02 Thread Vincent Ren
On Apr 1, 7:11 pm, "eryksun ()" wrote: > Try this instead: > > profile.runctx('timer.test(100, settime.setops, set.Set)', globals=globals(), > locals=locals()) It works! Thanks a lot -- http://mail.python.org/mailman/listinfo/python-list

A problem about ipython

2011-03-31 Thread Vincent Ren
Hey, everyone, I'm trying to use ipython recently. It's very nice, however, when I run this(from Programming Python 3rd) in ipython, I'll get a NameError: In [1]: import settime, timer, set In [2]: import profile In [3]: profile.run('timer.test(100, settime.setops, set.Set)') --

Re: questions about multiprocessing

2011-03-07 Thread Vincent Ren
I'm just learning python. After changed it to a non-OOP program, it works. Thank you all for suggestions :) On Mar 8, 1:38 pm, Benjamin Kaplan wrote: > Is there any particular reason you're using processes and not threads? > Functions that wait for stuff to happen in C land, such as I/O calls, >

Re: questions about multiprocessing

2011-03-07 Thread Vincent Ren
Got it, thanks. But what should I do if I want to improve the efficiency of my program? On Mar 8, 11:37 am, Robert Kern wrote: > I'm afraid his response applies to this as well: you can't pass methods to > pool.map() or any other such communication channel to your subprocesses. -- http://mail

Re: questions about multiprocessing

2011-03-07 Thread Vincent Ren
On Mar 7, 9:21 pm, Jean-Michel Pichavant wrote: > It's a mistake many beginners do, I don't understand why, but it's a > very common thing. RTFM should stand for "Read The Formidable (error) > Message" as  well. > Your url is invalid, check your url definition. > > JM I've fixed that problem. Bu

Re: questions about multiprocessing

2011-03-06 Thread Vincent Ren
I've got some new problems and I tried to search on Google but got no useful information. I want to download some images with multiprocessing.pool In my class named Renren, I defined two methods: def getPotrait(self, url): # get the current potraits of a friend on Renren.com

Re: questions about multiprocessing

2011-03-05 Thread Vincent Ren
Got it. After putting commas, it works (The 'o' was a mistake when I posted, sorry about it ). Thanks to all of you :) On Mar 5, 5:12 pm, Dennis Lee Bieber wrote: > On Fri, 4 Mar 2011 20:08:21 -0800 (PST), Vincent Ren > declaimed the following in > gmane.comp.python.g

questions about multiprocessing

2011-03-04 Thread Vincent Ren
Hello, everyone, recently I am trying to learn python's multiprocessing, but I got confused as a beginner. If I run the code below: from multiprocessing import Pool import urllib2 otasks = [ 'http://www.php.net' 'http://www.python.org' 'http://www.perl.org' 'http://www.gnu.org

Re: How to keep effects of image filters going for some seconds?

2010-04-03 Thread Vincent Ren
On Mar 22, 6:00 am, Terry Reedy wrote: > On 3/21/2010 3:23 AM, Ren Wenshan wrote: > > > > > Hello, every pythoner. > > > Firstly, I want to mention that English is my second language, so > > maybe there are some sentences which makes you confused, sorry. > > > I have been learning Panda3D, an open