本文整理汇总了Python中Cookie.SimpleCookie.split方法的典型用法代码示例。如果您正苦于以下问题:Python SimpleCookie.split方法的具体用法?Python SimpleCookie.split怎么用?Python SimpleCookie.split使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cookie.SimpleCookie
的用法示例。
在下文中一共展示了SimpleCookie.split方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SimpleCookie
# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import split [as 别名]
d.close()
success = True
if success:
print " <meta http-equiv='REFRESH' content='0;login.py?username=%s&password=%s'>" % (username, password)
print """<!--Info -->
<div class='container'>
<div class='alert alert-success'>
<h1>Account created successfully.</h1>
<p>You will be automatically logged in, or <a href="/cgi/login.py">click here to log in manually</a>.</p>
</div>
</div>
"""
elif 'KOOKIE' in kookie:
cookie = SimpleCookie(os.environ['HTTP_COOKIE'])['KOOKIE'].value
username = cookie.split("_")[0]
password = cookie.split("_")[1]
print " <META HTTP-EQUIV='refresh' CONTENT='5;URL=/'>"
print """<!--Info -->
<div class='container'>
<div class='alert alert-error'>
<h1>Already logged in.</h1>
<p>You will be automatically redirected in 5 seconds, or <a href="/">click here</a>.</p>
</div>
</div>
"""
else:
print """<!--Registration form -->
<div class='container'>
<form class='well' method='post'>
示例2: get_crumbs
# 需要导入模块: from Cookie import SimpleCookie [as 别名]
# 或者: from Cookie.SimpleCookie import split [as 别名]
def get_crumbs():
docCookie = doc().cookie
c = SimpleCookie(docCookie)
c = c.output(header='')
return map(strip, c.split('\n'))