Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6433

changing current dir and executing a shell script

From suresh <suresh.amritapuri@gmail.com>
Newsgroups comp.lang.python
Subject changing current dir and executing a shell script
Date 2011-05-27 14:25 -0700
Organization http://groups.google.com
Message-ID <c49d698b-183f-46a2-8367-c7db0761ba19@glegroupsg2000goo.googlegroups.com> (permalink)

Show all headers | View raw


Hi,
I want to execute the following command line stuff from inside python. 
$cd directory
$./executable

I tried the following but I get errors
import subprocess
subprocess.check_call('cd dir_name;./executable')

Due to filename path issues, I cannot try this version.
subprocess.check_call('./dir_name/executable')

Any suggestions?
thanks
suresh

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

changing current dir and executing a shell script suresh <suresh.amritapuri@gmail.com> - 2011-05-27 14:25 -0700
  Re: changing current dir and executing a shell script Thorsten Kampe <thorsten@thorstenkampe.de> - 2011-05-28 00:18 +0200
  Re: changing current dir and executing a shell script Albert Hopkins <marduk@letterboxes.org> - 2011-05-27 18:19 -0400
    Re: changing current dir and executing a shell script Peter Otten <__peter__@web.de> - 2011-05-28 09:41 +0200
      Re: changing current dir and executing a shell script Albert Hopkins <marduk@letterboxes.org> - 2011-05-28 17:52 -0400

csiph-web