[Tutor] raw string - solution to open_new() problem

Alan G alan.gauld at freenet.co.uk
Mon Aug 8 20:08:57 CEST 2005

> webbrowser.open_new(r"file://C:\__Library\folders\02394 Yale Style 
> Manual\02394 Yale_Style_Manual.htm")
> does.
> Thank you Ewald, for triggering the solution in my mind!
> Now, if anyone can explain why webbrowser.open_new() does the 
> character  substitution thing it was doing (and thus becoming unable 
> to locate the  file in question), I'm eager to hear it.

It's not the function that does it, it's Python itself.

If you just try using print for the two values(with and without 'r') 
you will see
the same effect. It's standard Python string handling.

Alan G. 

More information about the Tutor mailing list