0
對於某些項目,我使用基於python的Google App Engine編寫Webapps,我必須使用%運算符來使用python的字符串替換功能。在python三重引號字符串中突出顯示替換字符串
我使用Notepad ++作爲我的編輯器。我需要一些在「」「三引號字符串中突出顯示替換標籤的機制,以便我可以很容易地跟蹤它們,如果它們嵌入到字符串中。例如,下面是一個python三重引號字符串,我正在使用:
form = """
<form method="post" >
When is you Birthday?
<br>
<label> Day <input type="text" name="dd" value = "%(day)s"> </label>
<label> Month <input type="text" name="mm" value = "%(month)s"> </label>
<label> Year <input type="text" name="yy" value = "%(year)s"> </label>
<div style="color: red"> %(error)s </div>
<br>
<br>
<input type="submit" value="Submit" >
</form>
「」」
現在,沒有的(嵌入在此字符串)■模式的所有%正確的高亮,這是相當困難的我的判斷。這個三重引用字符串中總共嵌入了4個這樣的模式。 (日,月,年和錯誤)
如果有人知道這個問題的解決方法,請讓我知道。
問候 懷德,阿布舍克