newbie question
jeff
plastic"no-spam-pls" at xsintrk.net
Thu Apr 15 17:29:29 EDT 2004
Krzysztof Stachlewski <stach at fr.USUN.pl> wrote in
news:c5mtsl$dns$2 at absinth.dialog.net.pl:
> jeff wrote:
>
>> ex:
>>
>> a = "text str"
>> if a == "text str": print a
>>
>> why doesn't that work? i couldn't find much help about variable
>> types in the manual, does it need a property like a.text?
>
> It works - at least on my computer.
> That is: it prints "text str" to the console.
> What did you expect it to do?
>
ok this is the bit i'm working with, i'm tinkering with sockets.
when the recieved text == kill, i want the socket to close. actually, the
example i posted worked for me too, but i don't understand why this
doesn't.
while 1:
sdata = s.recv(1024)
if not sdata: break
if sdata == "kill": s.close()
print "Recieved:", sdata
More information about the Python-list
mailing list