Can anyone explain a part of a telnet client code to me..
Gabriel Genellina
gagsl-py at yahoo.com.ar
Sun Feb 11 00:06:53 EST 2007
More information about the Python-list mailing list
Sun Feb 11 00:06:53 EST 2007
- Previous message (by thread): Can anyone explain a part of a telnet client code to me..
- Next message (by thread): os.tmpfile() -> permission denied (Win XP)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
En Sun, 11 Feb 2007 00:48:57 -0300, Jia Lu <Roka100 at gmail.com> escribió: > I have a program that can telnet to a host. > But I cannot understand from [for c in data] part, can anyone explain > it to me? data is the received string. The for statement is used to iterate over a sequence; a string is considered a sequence of characters, so it iterates over all the characters in the string, one by one. py> data = "Hello" py> for c in data: ... print c, ord(c) ... H 72 e 101 l 108 l 108 o 111 py> -- Gabriel Genellina
- Previous message (by thread): Can anyone explain a part of a telnet client code to me..
- Next message (by thread): os.tmpfile() -> permission denied (Win XP)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list