[SciPy-user] Interactive handling in scipy
Nils Wagner
nwagner at mecha.uni-stuttgart.de
Fri Aug 22 03:14:56 EDT 2003
"Travis E. Oliphant" schrieb:
>
> Nils Wagner wrote:
> > Dear experts,
> >
> > Let us assume, that we have a vector say a with n elements.
> > The user should specify a certain element out of this array.
> > How can I realize this task in scipy.?
> >
> > for i in arange(0,n):
> >
> > print i, a[i]
> >
> > print 'Choose a numer 0 <= i <n'
> >
> > User input >> j
> >
>
> Python handles this most easily using raw_input.
>
> >>> info(raw_input)
> raw_input([prompt]) -> string
>
> Read a string from standard input. The trailing newline is stripped.
> If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
> On Unix, GNU readline is used if enabled. The prompt string, if given,
> is printed without a trailing newline before reading.
>
> If you want to get real fancy you can play with Python's tty module and
> do all kinds of crazy things.
>
> >>> help(tty)
>
> for more information.
>
> -Travis O.
>
It seems to me, that this module is not available here.
Python 2.1.2 (#1, Feb 25 2002, 18:04:21)
[GCC 2.95.3 20010315 (SuSE)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> help (tty)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'help' is not defined
>>> from scipy import *
>>> help(tty)
Traceback (most recent call last):
File "<stdin>", line 1, in ?
NameError: name 'tty' is not defined
Am I mssing something ?
Nils
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
More information about the SciPy-User
mailing list