the errors when using the subprocess.Open

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sherry1125
    New Member
    • Nov 2014
    • 1

    the errors when using the subprocess.Open

    i am a beginner, i tried to have python to run a binary file
    my code looks like this:
    Code:
    import subprocess as sp
    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.
    Last edited by bvdet; Nov 4 '14, 03:10 AM. Reason: Add code tags
  • bvdet
    Recognized Expert Specialist
    • Oct 2006
    • 2851

    #2
    I think you need to call subprocess.call or subprocess.Pope n. See Python documentation.

    Comment

    Working...