"Avell Diroll" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 3c273 wrote:
> > I was just trying to learn how to use .communicate() and all of the
examples
> > I see have [0] after .communicate(). What is the significance of the
[0]?
>
>
> From the Python Library Reference
> (http:/
[EMAIL PROTECTED] wrote:
(snip)
> I have a linux box, from where I remotely execute all the commands. The
> remote machine is windows machine. I installed an OpenSSH server for
> windows to send the shutdown command. I setup the public keys in such a
> way that I could login to SSH server without u
3c273 wrote:
> I was just trying to learn how to use .communicate() and all of the examples
> I see have [0] after .communicate(). What is the significance of the [0]?
From the Python Library Reference
(http://docs.python.org/lib/node239.html), you learn that the method
communicate() from the
[EMAIL PROTECTED] wrote:
> I have a question on getpass. Since I am a newbie you might find it a
> little dumb.
>
> By using the getpass, are u trying to retrieve the username and
> password of remote mahcine or local ?
>
the module getpass contains 2 functions, getuser() and getpass() :
getuse
"Avell Diroll" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> ##Python Script :
> from subprocess import Popen
> p1 = Popen(["dmesg"], stdout=PIPE)
> p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
> output = p2.communicate()[0]
I was just trying to learn how to use .commu
Hi Avell,
I want to communicate using subprocess module but my task is a little
different. May be you can guide me.
I have a linux box, from where I remotely execute all the commands. The
remote machine is windows machine. I installed an OpenSSH server for
windows to send the shutdown command. I
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
>> So basically, instead of typing in on the command line argument I want
>> to have it in a python program and let it do the action.
>
> Try exec() and execfile() from the standard library (IIRC)
Ths os.spawn...() functions are likely to b
I have a question on getpass. Since I am a newbie you might find it a
little dumb.
By using the getpass, are u trying to retrieve the username and
password of remote mahcine or local ?
Avell Diroll wrote:
> [EMAIL PROTECTED] wrote:
> > When you connect (via ssh or telnet) to a remote machine, y
[EMAIL PROTECTED] wrote:
> When you connect (via ssh or telnet) to a remote machine, you need to
> type (manually)
> your username and your password. Programming that is never easy.
>
This is really eased by the module getpass (std library) :
###
import getpass
login = getpass.getuser()
passwo
[EMAIL PROTECTED] wrote:
> I tried the following and it seemed to work
>
> import os
> os.system('')
>
> Any comments
>
This is an simple way to proceed if you don't need your python script to
know what happens to the launched process ...
When you need to :
* send some input to the command
I tried the following and it seemed to work
import os
os.system('')
Any comments
--
http://mail.python.org/mailman/listinfo/python-list
When you connect (via ssh or telnet) to a remote machine, you need to
> type (manually)
> your username and your password. Programming that is never easy.
I have setup the public keys to AUTO LOGIN so that it doesn't ask the
password.
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
<[EMAIL PROTECTED]> wrote:
>[EMAIL PROTECTED] a écrit :
>
>> So basically, instead of typing in on the command line argument I want
>> to have it in a python program and let it do the action.
>
>Try exec() and execfile() from the standard library (IIRC)
>
>>
>> for
[EMAIL PROTECTED] wrote:
> I want to write a python program and call OS specific commands in it.
> So basically, instead of typing in on the command line argument I want
> to have it in a python program and let it do the action.
There are several ways to do so :
* os.system() if you just want to l
[EMAIL PROTECTED] a écrit :
> So basically, instead of typing in on the command line argument I want
> to have it in a python program and let it do the action.
Try exec() and execfile() from the standard library (IIRC)
>
> for example. in my program I would want to call the ssh feature like
> on
[EMAIL PROTECTED] wrote:
> I want to write a python program and call OS specific commands in it.
> So basically, instead of typing in on the command line argument I want
> to have it in a python program and let it do the action.
>
> for example. in my program I would want to call the ssh feature l
16 matches
Mail list logo