Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我将变量传递给 web.py 中的模板,并且在某些地方具有相同的条件。像这样:
$if myvar=="string1":
$passed argument1
…………
$if myvar =="striung2":
$passed argument2
如果说 myvar 是 "string1" 并且我通过了 pass = "AAA" 那么我的页面上有 AAA argument1,但是其他 if 语句被空字符串替换?
如何避免这种情况?即如何保持其他语句完好无损?
你的问题不清楚。你想做什么?听起来你只需要使用其他:
if myvar == "string1": print passed else: # something
但是很难理解你在问什么。