By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,116 Members | 1,319 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,116 IT Pros & Developers. It's quick & easy.

the errors when using the subprocess.Open

P: 1
i am a beginner, i tried to have python to run a binary file
my code looks like this:
Expand|Select|Wrap|Line Numbers
  1. import subprocess as sp
  2. p2=sp.Open(['./nandpro','-0' repr(rdppa),'-b',repr(block),'-c',repr(ch_num),'-d',datafilename,'-m',metafilename,'-f','bad_mark.txt'],stdout=sp.PIPE,stderr=sp.PIPE)
It means to create two file metafile and datafile,read data from flash and write them to these files.But the result of run the code don't meet my demand.(PS. I run ./nandpro -0 0x96 -b 100 -c 0 -d datafilename -m metafilename -f badmark.txt the result is right)
print number

i am using python 2.7

please help, thank you very much.
Nov 4 '14 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 2.5K+
P: 2,851
I think you need to call or subprocess.Popen. See Python documentation.
Nov 4 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.