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

Re: A problem about ipython

2011-04-01 Thread Robert Kern
On 3/31/11 8:48 PM, Vincent Ren wrote: 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, sett

Re: A problem about ipython

2011-04-01 Thread eryksun ()
On Thursday, March 31, 2011 9:48:27 PM UTC-4, Vincent Ren wrote: > > when I run this(from Programming Python 3rd) in ipython, I'll > get a NameError: > > > /usr/lib/python2.6/profile.pyc in runctx(self, cmd, globals, locals) > 460 sys.setprofile(self.dispatcher) > 461

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)') --