← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #242206]: write os.system generated message to csv-file

 

Question #242206 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/242206

RaiMan proposed the following answer:
@obiwan-92
With subprocess.Popen() you have to either use a list of strings building the command line with the first being the program to run or one string, that is taken as the command with it's parameters (difficult if some quoting is needed.

Since he uses $() it seems to be a unix-like system (Mac or Linux). The the program to run the echo is the shell.
For these cases Popen has to be told to use the shell:

p = sub.Popen("echo $(date +'%Y-%m-%d
%H:%M:%S')",shell=True,stdout=sub.PIPE,stderr=sub.PIPE)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.