![]() |
\ as a character, not escape sequence
I am parsing a text file and during the process I need to check for a '\'. Python of course thinks I am trying to use the escape sequence. Any way around this?
Here is some example code: :
if self.data[index] == '\': |
Use "\\". That will give you a single, literal backslash.
|
Thanks so much!
|
| All times are GMT -5. The time now is 1:30 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC