Δηλαδή χρειάζεσαι μόνο αυτό το.. telnet prompt;
#!/usr/bin/python
from subprocess import *
command = ["/usr/bin/telnet", "192.168.1.1"]
p = Popen(command, stdin=PIPE, stderr=PIPE, stdout=PIPE)
# Grabs the stdout and kills the process
out = p.communicate()[0]
print(p.wait())
msg = "Command {0}\nOutput: {1}"
print(msg.format(" ".join(command), out))
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://lists.ubuntu.com/archives/ubuntu-gr/attachments/20120123/3fc3e7f0/attachment.html>
--
Ubuntu-gr mailing list
[email protected]
If you do not want to receive any more messages from the ubuntu-gr mailing
list, please follow this link and choose unsubscribe:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-gr