running commands with sudo & python

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • coldsoul4e@googlemail.com

    running commands with sudo & python

    Hi!
    I must execute a command with os.command(), but with root permissions.
    Is there anyway to do that with python?
    Thanks

  • John Bauman

    #2
    Re: running commands with sudo & python

    coldsoul4e@goog lemail.com wrote:
    Hi!
    I must execute a command with os.command(), but with root permissions.
    Is there anyway to do that with python?
    Thanks
    >

    Of course, it's not generally a good idea to have your program keep root
    permissions after it does whatever it needs to do.

    Comment

    • db

      #3
      Re: running commands with sudo & python


      Hi there,

      I think you can do that with pexpect

      Download Pexpect - Pure Python Expect-like module for free. Pexpect is a Python module for spawning child applications; controlling them;


      good luck

      On Thu, 28 Sep 2006 14:18:14 -0700, coldsoul4e wrote:
      Hi!
      I must execute a command with os.command(), but with root permissions.
      Is there anyway to do that with python?
      Thanks


      Comment

      Working...