sl is defined already as a file object, and t is a string.
sent = False
for line in sl:
if line == t:
sent = True
if sent == False:
#do something
sl.write(t)
If there is a better way to do this, and I'm completely off course, please let me know. I have been teaching myself python and can't get this section of my code to work like it should.

New Topic/Question
Reply




MultiQuote




|