Re: Raw Strings with Variables

2009-08-19 Thread Terry Reedy
WilsonOfCanada wrote: Hellos, I know that if you have: happy = rC:\moo print happy you get C:\moo instead of C:\\moo The thing is that I want to do this a variable instead. ex. testline = fileName.readline() rawtestline = r testline Python does not have 'raw strings'. It only has

Raw Strings with Variables

2009-08-18 Thread WilsonOfCanada
Hellos, I know that if you have: happy = rC:\moo print happy you get C:\moo instead of C:\\moo The thing is that I want to do this a variable instead. ex. testline = fileName.readline() rawtestline = r testline Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw Strings with Variables

2009-08-18 Thread Albert Hopkins
On Tue, 2009-08-18 at 16:16 -0700, WilsonOfCanada wrote: Hellos, I know that if you have: happy = rC:\moo print happy you get C:\moo instead of C:\\moo The thing is that I want to do this a variable instead. ex. testline = fileName.readline() rawtestline = r testline I'm

Re: Raw Strings with Variables

2009-08-18 Thread WilsonOfCanada
You're right, but the moment I append it onto a list, it would become C:\\moo. arrPlaces = [] intPoint =0 while (len(testline)): testline = fileName.readline() print testline arrPlaces[intPoint].append(testline) intPoint += 1 print arrPlaces C:\moo C:\supermoo

Re: Raw Strings with Variables

2009-08-18 Thread Chris Rebert
On Tue, Aug 18, 2009 at 5:09 PM, WilsonOfCanadaw...@sfu.ca wrote: You're right, but the moment I append it onto a list, it would become C:\\moo. arrPlaces = [] intPoint =0 while (len(testline)):        testline = fileName.readline()        print testline        

Re: Raw Strings with Variables

2009-08-18 Thread Jan Kaliszewski
Dnia 19-08-2009 o 02:09:29 WilsonOfCanada w...@sfu.ca napisał(a): You're right, but the moment I append it onto a list, it would become C:\\moo. No, it would not. Really! C:\moo C:\supermoo ['C:\\moo', 'C:\\supermoo'] It is not the matter of content of the string but only of a way of

Re: Raw Strings with Variables

2009-08-18 Thread WilsonOfCanada
However, when I send the list over as a dictionary for HTML: d[places] = arrPlaces return render_to_response('rentSearch.html', d) the HTML using Django has: {{ places }} but returns ['C:\\moo', 'C:\\supermoo'] -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw Strings with Variables

2009-08-18 Thread Chris Rebert
On Tue, Aug 18, 2009 at 5:51 PM, WilsonOfCanadaw...@sfu.ca wrote: However, when I send the list over as a dictionary for HTML: d[places] = arrPlaces return render_to_response('rentSearch.html', d) the HTML using Django has: {{ places }} but returns ['C:\\moo', 'C:\\supermoo'] As we've