raw string

James Stroud jstroud at mbi.ucla.edu
Tue Sep 18 11:41:10 CEST 2007


Konstantinos Pachopoulos wrote:
> Hi,
> i am trying to execute the following query on a DB:
> qe.execQuery(r"SELECT * FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY 
> '"' LINES TERMINATED BY '\n' FROM Commiter")
> 
> However, whether i put the r in the front or not, i always get an error 
> about the "\n".
> What's wrong?

Try Triple-quoting the whole thing (you have an un-escaped " in your 
present version):

   r"""SELECT[yadda][yadda]Commtter""""

James



More information about the Python-list mailing list