Telnet Problem

DeepBleu DeepBleu at DeepBleu.org
Tue Jan 15 16:23:05 CET 2002


I am running into the following frustration problem:
I am telneting a server to run a command on it.  When I run the script in
interactive mode (line by line in PythonWin 2.1.211), it works.  When I run
the script, it does not work.
This is the very simple script:
######################### Start
from telnetlib import Telnet
tn=Telnet("dvlp")
tn.read_until("login: ")
tn.write("UserID\n")
tn.read_until("Password: ")
tn.write("UserPWD\n")
tn.read_until("data>")
tn.write("cd ..\n")
tn.read_until("server>")
tn.write("cd bin\n")
tn.read_until("bin>")
tn.write('newjob "par1" "PathToFile" "PythonWin Test"' + "\n")
tn.close()
################################################## End
As I said, when I run it line by line,  the process 'newjob "par1"
"PAthToFile" "PythonWin Test"'  takes place fine.  When run in the regular
way as a script,  the same process does not take place.
Can anyone help with any hints.
Thanks,
DeepBleu





More information about the Python-list mailing list