Hi Daniela,

On Mon, Jul 9, 2012 at 4:17 PM, Wörz Daniela
<[email protected]> wrote:
> the slashes in the path will be wrong interpreted:
>
> os.startfile("[% "DOC_Path" %]")
[[snip]]
> WindowsError: [Error 2] System can not find stated file
> '\\avlrbrc103a\x0biia\\state\x0b_City\xob.14.xls'

you must escape again your backslashes (\) (duplicating them)
because the 2 interpretation steps, from expression engine
and then from python interpreter, something like:

os.startfile("[% replace("DOC_Path", '\\', '\\\\') %]")

or just replace them with a slashes (/) since the python interpreter
replace slashes on path with backshashes on WinOS:

os.startfile("[% replace("DOC_Path", '\\', '/') %]")

I'd suggest the second approach because you're sure you don't
get any problems if the string is further interpreted and in
addition it should works on all the OSs.

Regards.

-- 
Giuseppe Sucameli - Faunalia
_______________________________________________
Qgis-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to