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


Groups > comp.lang.python > #6436

Re: changing current dir and executing a shell script

From Thorsten Kampe <thorsten@thorstenkampe.de>
Newsgroups comp.lang.python
Subject Re: changing current dir and executing a shell script
Date 2011-05-28 00:18 +0200
Message-ID <MPG.284a41bcc404f1f7989819@news.individual.de> (permalink)
References <c49d698b-183f-46a2-8367-c7db0761ba19@glegroupsg2000goo.googlegroups.com>

Show all headers | View raw


* suresh (Fri, 27 May 2011 14:25:52 -0700 (PDT))
> 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')

os.chdir?

Back to comp.lang.python | Previous | NextPrevious in thread | Next 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