[Tutor] script error question
Kirk Bailey
idiot1@netzero.net
Mon Dec 16 00:51:02 2002
Folks, I get this error when examining a string for the presence of a smaller
string:
Traceback (innermost last):
File "/www/www.tinylist.org/cgi-bin/TLlistkill2.py", line 187, in ?
if mylist not in aliasline: # if this is NOT the alias to remove,
TypeError: string member test needs char left operand
Here is the block of code it is happening inside of:
while 1: # create a loop
aliasline=string.strip(f1.readline()) #
if aliasline=="":
break # break the loop!
print aliasline+'<br>'
if mylist not in aliasline: #
f2.write(aliasline+"\n")#
f1.close() #
f2.close() #190
os.remove('./lists/aliases.tinylist') # delete oldfile
os.rename('./lists/aliases.new','/etc/mail/aliases.tinylist')
# And rename the new aliases file
os.system('newaliases') # issue 'newaliases'
print '<P><center><B>DONE.</b></center>' #
print '<br>Hope you wanted it that way.</center><br>'
print footer #
sys.exit(0) # now exit.
Anyone intrested, feel free totell me more about this, I thought I had it right.
--
end
Respectfully,
Kirk D Bailey
+---------------------"Thou Art Free." -Eris-----------------------+
| http://www.howlermonkey.net mailto:highprimate@howlermonkey.net |
| KILL spam dead! http://www.scambusters.org/stopspam/#Pledge |
| http://www.tinylist.org +--------+ mailto:grumpy@tinylist.org |
+------------------Thinking| NORMAL |Thinking----------------------+
+--------+
---------------------------------------------
Introducing NetZero Long Distance
1st month Free!
Sign up today at: www.netzerolongdistance.com