[IPython-User] running sum(datetime.timedelta) gives an error! but not always
Thu Jun 27 13:06:39 CDT 2013
If you start IPython with `--pylab`, then `sum` is actually `numpy.sum`,
rather than the builtin.
On Mon, Jun 24, 2013 at 1:09 PM, BrunoV <email@example.com> wrote:
> Hello, I'm new to this list and a beginner in python.
> I'm trying to use datetime module.
> to do it simple here is the part of the code I'm using:
> import datetime as dtm
> toto = [[dtm.timedelta(0, 25200), dtm.timedelta(0, 3600)]]
> print sum(toto)
> If I start ipython with this line:
> ipython -pylab -wthread and then copy paste these lines in Ipython console
> using %cpaste
> everything it is working as expected.
> But if I run the file containing this portion of code using the %run
> the_file.py, I get the following error:
> TypeError: unsupported operand type(s) for +: 'int' and 'list'
> WARNING: Failure executing file: <try.py>
> I get the same error in Ipython console when Ipython is started without any
> So I suppose the error is linked with the use of pylab option.
> Is it normal that using %run, and using %cpaste I'm getting the same
> How can I get my script working using %run
> Thank you very much for your answers.
> View this message in context:
> Sent from the IPython - User mailing list archive at Nabble.com.
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User