Re: execute commands and return output



billiejoex wrote:
> Thank you for your help but I'm searching a different way.
> Moreover it doesn't work always (for exaple: try a 'dir' command).
> Because of I'm implementing a remote shell the
> [[os.popen('command').read()]] rapresents the best for me because it can
> also accepts arguments direclty (for example:
> os.popen('netstat -a -n -o').read() and this is a great advantage.

If you really need shell evaluation, try subprocess.Popen('foo',
shell=True) instead.
.



Relevant Pages

  • Re: execute commands and return output
    ... Thank you for your help but I'm searching a different way. ... Moreover it doesn't work always (for exaple: try a 'dir' command). ... > from subprocess import Popen, ...
    (comp.lang.python)
  • Re: remote shell on windows 2000 server.
    ... when using UPD port 69 (The same port that the tftp transaction ... I can execute command line paramteres via the ... any advice for me that would allow me to obtain remote shell? ...
    (Pen-Test)
  • Re: rsh & hp-ux oddities
    ... wheras remsh is the "remote shell". ... But what do i use if I want to run the remote command from a Solaris ... ie I am logged onto a solaris system, and want to run the command date ...
    (comp.sys.hp.hpux)
  • [HPADM] Summary: some issue with rsh
    ... Trick is to link your command into above path. ... regarding these files allowing usage of remote shell. ... exception of one old application connection that system using rsh. ... for connecting system 11.xx ...
    (HP-UX-Admin)
  • Re: Running an application automatically after a ssh login.
    ... and issuing a command from the remote shell after login. ... use the remote shell for programs like mutt, ...
    (comp.os.linux.networking)