mirror of
https://github.com/Death916/emailtrade.git
synced 2026-04-10 03:04:40 -07:00
add glogin
This commit is contained in:
parent
75a649956d
commit
02a501d9e9
2 changed files with 16 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -3,7 +3,7 @@ keys\.json
|
|||
|
||||
tradehist\.txt
|
||||
|
||||
glogin\.py
|
||||
|
||||
|
||||
*.pyc
|
||||
|
||||
|
|
|
|||
15
glogin.py
Normal file
15
glogin.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import imapclient
|
||||
import json
|
||||
with open('D:/code/emailtrade/keys.json') as k:
|
||||
keys = json.load(k)
|
||||
|
||||
def connect():
|
||||
email = keys['email']
|
||||
passw = keys['passw']
|
||||
|
||||
server = imapclient.IMAPClient('imap.gmail.com', ssl=True)
|
||||
server.login(email, passw)
|
||||
print('login success')
|
||||
|
||||
return server
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue