By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,275 Members | 1,745 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,275 IT Pros & Developers. It's quick & easy.

pyshell and unum hint

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.