Is it possible to escape double qoutes character in tal:define and tal:attribute python variables?

For example if I was to use this button, button onclick="window.location.href='page.html'"
If I use tal:attributes or tal:define how am I able to escape the double qoutes? I tried the single backslash but it's throwing syntax error. What I tried.

<span tal:define="path python:"window.location.href="'page.html'">
button tal:attributes="href python:path">
button tal:attributes="href python:'='+path">

Is there a work around?

You need want to use string: rather than python: and inner single quotes:

 tal:define="path string:window.location.href='page.html' "

Are we allowed to use variables with path string?
What if my href is tal:define="href1 python:'?opflag=edit&category=%s&cat_id=%d&physical_name=%d' %(category,cat_id,physical_name);"

And I want tal:define="path string:window.location.href='%s' % href1"
Which would then be used for button tal:attributes="onclick path"

Never mind I found my answer. I was able to escape the using single quotes for the double quotes and it worked as it should.

Slightly off topic, but there is hardly any need for using 'tal:attributes' anymore:

Usually, you can just do

<a href='${python: path}'

(and similar with 'other stuff, like:

<img alt="${context/Description}" ....

UPDATE: I just used python:path since it was in the question, probably no need here. You might also consider doing all the 'calculations' in a browserview.py - file , and use

<a href="${view/somecalculations}" >