1 |
120921 Marc Joliet wrote: |
2 |
> 120921 Philip Webb <purslow@××××××××.net> wrote: |
3 |
>> Is that possible with Python ? -- ie a setting in ascript.py |
4 |
>> to tell Python to display only the 1st 4 places in all output |
5 |
>> without any further input from the user when doing the calculations; |
6 |
>> presumably it wb a command s/he could enter when in interactive mode too. |
7 |
> I couldn't find anything for regular python on the fly |
8 |
> (except by using the "decimal" module, see |
9 |
> http://docs.python.org/library/decimal.html#module-decimal |
10 |
|
11 |
Yes, I found that too, but it requires typing 'Decimal' or 'D' |
12 |
every time you want the shorter output (grimace). |
13 |
What I would like is something which applies globally to the output, |
14 |
but it looks as if there's nothing available. |
15 |
|
16 |
I can do everything I need via the little script |
17 |
-- I can predefine variables there ! -- |
18 |
& I don't mind loading "math" every time, |
19 |
as I have no other present use for interactive Python. |
20 |
I am now a bit ahead of where I was when I first asked (smile). |
21 |
|
22 |
Thanks for this & the other reply. |
23 |
|
24 |
-- |
25 |
========================,,============================================ |
26 |
SUPPORT ___________//___, Philip Webb |
27 |
ELECTRIC /] [] [] [] [] []| Cities Centre, University of Toronto |
28 |
TRANSIT `-O----------O---' purslowatchassdotutorontodotca |