Python Hotmail登录

str*_*k3r 2 python

我需要一个提示输入用户名和密码的python脚本,并尝试使用这些凭据登录Hotmail,输出它们是否有效.

raz*_*tia 5

Hotmail登录!

import poplib

M = poplib.POP3_SSL('pop3.live.com', 995) #Connect to hotmail pop3 server
try:
    M.user(raw_input("username: ")) #Get the username from the standar input
    M.pass_(raw_input("password: ")) #Get the password from the standar input
except:
    print "username or password incorrect"
else:
    print "Successful login"
Run Code Online (Sandbox Code Playgroud)

编辑:因为您只需要知道您是否可以登录,我会重写代码

如果在输入用户名或密码时丢失连接,我不知道会发生什么.