python os.popen, os.system, subprocess.popen, subprocess.call

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siavashr
    New Member
    • Aug 2010
    • 1

    python os.popen, os.system, subprocess.popen, subprocess.call

    Hi,

    I am new to python, and I am trying to do the following from my python code:

    echo 1 > /sys/devices/omapdss/display0/enabled

    I have tried to do this with the following functions:
    Code:
    os.popen('echo 0 > "/sys/devices/omapdss/display0/enabled"')
    
    os.system('echo 0 > "/sys/devices/omapdss/display0/enabled"')
    
    subprocess.call('echo 0 > /sys/devices/omapdss/display0/enabled', shell=True)
    
    
    subprocess.popen('echo 0 > /sys/devices/omapdss/display0/enabled', shell=True)
    All of the above functions work in python command prompt, but from my script os.system and os.popen do not do anything and subprocess.pope n and subprocess.call give: [Errno 12] Cannot allocate memory
    My code runs on Angstrum Linux

    Any input is appreciated.

    Cheers,
    Siavash
Working...