Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:11.13.1 Telnet ObjectsUp:11.13 telnetlibNext:11.14 urlparse

 
11.13.2 Telnet Example

A simple example illustrating typical use:

import getpassimport sysimport telnetlibHOST = "localhost"user = raw_input("Enter your remote account: ")password = getpass.getpass()tn = telnetlib.Telnet(HOST)tn.read_until("login: ")tn.write(user + "\n")if password:    tn.read_until("Password: ")    tn.write(password + "\n")tn.write("ls\n")tn.write("exit\n")print tn.read_all()


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:11.13.1 Telnet ObjectsUp:11.13 telnetlibNext:11.14 urlparse
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp