重定向到Python中的网站
问题描述:
我在第1天使用Python,并且刚刚创建了此管理员登录页面脚本。 如果在插入正确的用户名和密码时将网址重定向到网站,我很乐意。 我已经在*上搜索过这个,但是我找不到“简单”的东西。 有什么建议吗?重定向到Python中的网站
print ("Pannello di Log-In in caricamento")
import time
time.sleep (2)
username=raw_input ("USERNAME: ")
if username=="admin":
time.sleep (1)
print (" ")
else:
time.sleep (1)
print (" ")
password=raw_input ("PASSWORD: ")
if password=="psw":
time.sleep (1)
print ("LOGGING-IN")
else:
time.sleep (1)
print ("LOGGING-IN")
答
从蟒蛇打开一个网页:
import webbrowser
webbrowser.open('http://example.com') # Go to example.com
哪个网站?它是你自己的网站?你在用Python构建一个网站吗? – just10minutes
如果这是第1天,只需执行'print','if'和'raw_input'的小脚本即可。不要担心重定向和网站。你还没到。 – khelwood
我认为这对于已经写了python 1天的人来说是一个非常好的和明确的问题,我认为它不值得推荐。 –