[Grml] Calculators

Ulrich Dangel schula at grml.org
Thu Nov 2 23:10:12 CET 2006


* Michael Schierl wrote [02.11.06 22:58]:
Hi,
> and (how) can I reference previous outputs? I can name them beforehand
> but if I do it is lots more to type. Using screen or gdm to copy the
> value is not better either.
> 
> -----
> >>> 0xAFFE
> 45054
> >>> previous * 2
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> NameError: name 'previous' is not defined
> >>>
> -----

You just can do 0xAFFE*2 or something like
variable=0xAFFE
variable*2

Btw. ipython is much nicer for such stuff, there you can access the last
output with _ and the previous with __ and so on. _i is the last input
and __i is the previous ....

So you can easily calculate :)

Uli
-- 
Was an Büchern mit am besten ist: Manchmal sind da ganz phantastische Bilder drin.
George Walker Bush in U.S. News & World Report, 3. Januar 2000



More information about the Grml mailing list