Launching scripts in Ubuntu ?

Diez B. Roggisch deets at nospam.web.de
Tue Oct 14 07:35:49 EDT 2008


>> What do you mean "it's not closed"?
> well the command prompt (if it is called that way in Linus) is not
> returned.
> 
> When I run file_support, the command window looks like this
>  >>>python file_support.py
> ..... all kinds of output
>  >>>
> 
> When I run test.py (which calls fie_support) , I get this
>  >>>python test.py
> .... all kinds of output (the same as before)
> 
> Now I've to explicitly press an enter to get the command prompt back.
> This might not sound important,
> but the problem is somewhat more complex,
> all these scripts are ran from another program,
> and although everything works fine under windows,
> the program hangs on Ubuntu.
> So I guess that this is the (first) problem to solve.

This looks odd. I've never seen a *shell* display ">>>" as prompt. So it
looks as if you mix stuff between the shell (bash, tcsh, whatever) and
python in the above. Are you *inside* the python interpreter already when
typing "python test.py"? 

And if *not*, does typing e.g. "ls <return>" work for you, right after the
test.py is run? Then there is no "getting back of the prompt", it's just
that a last newline is .. well, not even missing, just not printed.
Consider this (I use $ for the shellpromt):

$ python -c "import sys;sys.stdout.write('hello')"
hello$

Additonally, you might want to check out the Popen-object-reference for the
wait-call, but actually that shouldn't change anything with regards to
pressing enter or not.

Diez



More information about the Python-list mailing list