469,909 Members | 1,613 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,909 developers. It's quick & easy.

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:
Expand|Select|Wrap|Line Numbers
  1. os.popen('echo 0 > "/sys/devices/omapdss/display0/enabled"')
  2.  
  3. os.system('echo 0 > "/sys/devices/omapdss/display0/enabled"')
  4.  
  5. subprocess.call('echo 0 > /sys/devices/omapdss/display0/enabled', shell=True)
  6.  
  7.  
  8. subprocess.popen('echo 0 > /sys/devices/omapdss/display0/enabled', shell=True)
  9.  
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.popen and subprocess.call give: [Errno 12] Cannot allocate memory
My code runs on Angstrum Linux

Any input is appreciated.

Cheers,
Siavash
Aug 28 '10 #1
0 1500

Post your reply

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

Similar topics

5 posts views Thread by Michele Simionato | last post: by
3 posts views Thread by madpython | last post: by
1 post views Thread by bahoo | last post: by
12 posts views Thread by Eric_Dexter | last post: by
7 posts views Thread by skunkwerk | last post: by
25 posts views Thread by Jeremy Banks | last post: by
2 posts views Thread by dudeja.rajat | last post: by
1 post views Thread by Mark Shewfelt | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.