473,322 Members | 1,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 922

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dcrespo | last post by:
I would like to adapt the PyShell code completion to DrPython, because both programs are very good... Any clue for start finding the code location in both programs to accomplish this? Thanks
2
by: Anita | last post by:
Hi All, I have a question about lock hint for you : If the first user currently run a select command with share lock and hold it. What kind of lock (lock hint) should be used by the second...
9
by: john smile | last post by:
Hi All, I want to lock 2 tables on 2 servers using TABLOCKX hint. These tables function as semaphores in my application. It means when the tables are locked then other users will not be able to...
2
by: Stephen McMahon | last post by:
Background: I am currently working on a mission critical web based application that is accessed 24 hours a day by users from just about every time zone. We use MS SQL Server as our database and...
1
by: Mark P | last post by:
Is an insert with hint (in say std::set) only beneficial if the insertion occurs immediately before the pointed to location of the hint? Suppose the insertion occurs right after the hint location? ...
3
by: rudymoore | last post by:
I'm often find-ing the same string in a map<string,xxx> I want to pass a hint to map::find but was disappointed to find that only map::insert takes the hint. Why would map::insert take a hint...
6
by: Mark P | last post by:
Some time ago I posted here about inserting into a set with a hint: ...
7
by: piperzen | last post by:
Hi, I'm developing a set of language learning exercises for http://www.yale.edu/swahili , and we've run into a javascript question that the programmer doesn't know how to tackle (we mostly work...
3
by: John Salerno | last post by:
I'm interested in trying out shells other than IDLE, and I found PyShell, but I'm not sure how to get it exactly. Is there a way to get it without installing wxPython, or is it a part of it? I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.