os.system dual behaviour

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • iu2

    os.system dual behaviour

    Hi guys

    I do

    os.system('ls &e')

    On one linux machine it emits ls output to the file e as expected.
    On another linux machine it emits ls to the standard output, and
    nothing to e!
    Both machines run Fedora linux.

    The command "ls &e" entered at the shell (no python) behaves ok on
    both machines.

    Why?? How can I solve this?

    Your help will be appreciated.
  • Emile van Sebille

    #2
    Re: os.system dual behaviour

    iu2 wrote:
    Hi guys
    >
    I do
    >
    os.system('ls &e')
    >
    On one linux machine it emits ls output to the file e as expected.
    On another linux machine it emits ls to the standard output, and
    nothing to e!
    Both machines run Fedora linux.
    >
    The command "ls &e" entered at the shell (no python) behaves ok on
    both machines.
    >
    Why?? How can I solve this?
    Why?? I don't know. But you could try the commands module to work
    around it...

    open("e",'w').w ritelines(comma nds.getoutput(' ls'))


    HTH,

    Emile

    Comment

    Working...