[Tutor] all the slashes

Gerhard Venter loper at ananzi.co.za
Fri Feb 6 11:23:21 EST 2004


Hi all

I use the code below in Python 2.3, but in 2.2 it says:
TypeError: 'in <string>' requires character as left operand
I have tried r'//',  and '////' (to escape the slashes) to no avail.  
How can I make this work in 2.2?

     myfile=open(r'/etc/sitelist','a')
     if "//" in mystring:

Thanks
Gerhard



More information about the Tutor mailing list