469,271 Members | 1,785 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

pyshell and unum hint

I like to have unum units imported automatically on my PYTHONSTARTUP
since I'm always converting things, and I also like to use pyshell.

They conflict for some reason I don't understand (pyshell doesn't like
the Unum.as method, maybe since it will be a keyword):

1.0*IN.as(M)
File "<input>", line 1
1.0*IN.as(M)
^
SyntaxError: invalid syntax

Instead I put this in my PYTHONSTARTUP:

from unum.tools.calc import *
Unum.to = Unum.as

Which gives:

1.0*IN.to(M)
0.0253999368687 [m]

Stephen

May 15 '07 #1
0 824

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by dcrespo | last post: by
2 posts views Thread by Anita | last post: by
9 posts views Thread by john smile | last post: by
2 posts views Thread by Stephen McMahon | last post: by
1 post views Thread by Mark P | last post: by
3 posts views Thread by rudymoore | last post: by
6 posts views Thread by Mark P | last post: by
7 posts views Thread by piperzen | last post: by
3 posts views Thread by John Salerno | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.