Guest User

Untitled

a guest
Feb 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. This is what happens:
  2.  
  3. Traceback (most recent call last):
  4. File "/home/dewaard/Python/Antiqbook/executiontest.py", line 8, in ?
  5. print >>f, "foobar"
  6. IOError: [Errno 9] Bad file descriptor
  7.  
  8. This is my code:
  9.  
  10. import os
  11. import sys
  12.  
  13. command = ("ftpasswd --passwd --file=%s --name=%s --uid=%d --home=%s --shell=%s --gid=%d" %
  14. ("/etc/proftpd/passwd", "foo", 5001, "/ftp/aar", "/bin/false", 5000))
  15.  
  16. f = os.popen(command)
  17. print >>f, "foobar"
  18. f.close()
Add Comment
Please, Sign In to add comment