python -i

Steve Holden sholden at holdenweb.com
Tue Oct 9 07:36:11 EDT 2001


"Peter Hansen" <peter at engcorp.com> wrote ...
> epchaves at yahoo.com.br wrote:
> >
> > __________________
> > import string
> >
> > a = string.lower("ÇÇÇÀÀÀAAA")
> > print a
> > ____________________
> >
> > if i do: python -i myfile.py
> >          the output is OK: çççàààaaa
> >
> > but if i do: python myfile.py
> >         the output isn't the expected: ÇÇÇÀÀÀaaa
>
> With this: ActivePython 2.1.1, build 212 (ActiveState)
>            Python 2.1.1 (#20, Jul 26 2001, 11:38:51) [MSC 32 bit (Intel)]
on win32
>
> I get the same result from either set of command line arguments:
>
> C:\>python test.py
> ÇÇÇÀÀÀaaa
>
> C:\>python -i test.py
> ÇÇÇÀÀÀaaa
> >>>

Which is exactly what one might have expected: Jorge, why did you expect the
"-i" argument to do something other than go interactive after execution? You
seem to expect it to affect your locale, or something similar ...

$ python --help
...
-i     : inspect interactively after running script, (also PYTHONINSPECT=x)
         and force prompts, even if stdin does not appear to be a terminal
...

Nothing there that might alter string.lower()'s behavior :-(

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list