Thanks for suggestions.
I'll try one of these solutions soon.
--
http://mail.python.org/mailman/listinfo/python-list
billiejoex wrote:
> Hi all. I'm searching for a portable (working on *nix and win32) function
> that executes a system command and encapsulate its output into a string.
> Searching for the web I found this:
>
> os.popen('command').read()
>
> It is perfect but when che command return an error the
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
"billiejoex" wrote:
> Moreover it doesn't work always (for exaple: try a 'dir' command).
why use os.system("dir") when Python already offers things
like os.listdir, os.walk, and glob.glob ?
--
http://mail.python.org/mailman/listinfo/python-list
Hi !
Look (the doc for) Popen2, Popen3, Popen4 & Subprocess
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
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
"billiejoex" wrote:
> Hi all. I'm searching for a portable (working on *nix and win32) function
> that executes a system command and encapsulate its
> output into a string.
> Searching for the web I found this:
>
> os.popen('command').read()
>
> It is perfect but when che command return an error
billiejoex wrote:
> Hi all. I'm searching for a portable (working on *nix and win32) function
> that executes a system command and encapsulate its output into a string.
> Searching for the web I found this:
>
> os.popen('command').read()
>
> It is perfect but when che command return an error the