Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/349.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
python web应用程序在不同的时间表现出不同的行为_Python_Web - Fatal编程技术网

python web应用程序在不同的时间表现出不同的行为

python web应用程序在不同的时间表现出不同的行为,python,web,Python,Web,这段代码运行一个注册页面 它接受并检查它是否与正则表达式匹配 这里只检查错误案例 如果出现错误,则应显示错误,如无效用户名、无效密码、密码不匹配、无效电子邮件 import webapp2 import escape import regular form=""" <html> <head> <title>Sign Up</title> <style type="text/css"> .label {text-align: righ

这段代码运行一个注册页面

它接受并检查它是否与正则表达式匹配

这里只检查错误案例

如果出现错误,则应显示错误,如无效用户名、无效密码、密码不匹配、无效电子邮件

import webapp2
import escape
import regular
form="""
<html>
<head>
<title>Sign Up</title>
<style type="text/css">
  .label {text-align: right}
  .error {color: red}
</style>

</head>
<body>
<h2>Signup</h2>
<form method="post">
  <table>
    <tr>
      <td class="label">
        Username
      </td>
      <td>
        <input type="text" name="username" value="%(username)s">
      </td>
      <td class="error">
         %(user_error)s
      </td>
    </tr>

    <tr>
      <td class="label">
        Password
      </td>
      <td>
        <input type="password" name="password" >
      </td>
      <td class="error">
        %(password_error)s
      </td>
    </tr>

    <tr>
      <td class="label">
        Verify Password
      </td>
      <td>
        <input type="password" name="verify" >
      </td>
      <td class="error">
        %(verify_error)s
      </td>
    </tr>

    <tr>
      <td class="label">
        Email (optional)
      </td>
      <td>
        <input type="text" name="email" value="%(email)s">
      </td>
      <td class="error">
        %(email_error)s

      </td>
    </tr>
  </table>

  <input type="submit">
  </form>
 </body>

 </html>

这是因为在调用该方法之前,我没有初始化所有错误

write_form(...   )
do this
     user_error=""
     password_error=""
     verify_error=""
     email_error=""

你会很乐意去的

你能提供一个简单的例子吗?你的代码中似乎还有很多地方可能出错,因此减少问题是至关重要的。谢谢..伙计..我发现了错误,如果你刚刚删除了你的错误,我会更喜欢。该问题特定于您的代码,对其他任何人都没有帮助。
write_form(...   )
do this
     user_error=""
     password_error=""
     verify_error=""
     email_error=""