put output folder in a variable
This commit is contained in:
parent
fd3cb6c75b
commit
75e84d50f8
|
@ -8,10 +8,11 @@ import re
|
||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
imapserver = ""
|
imapserver = ""
|
||||||
|
folder = "notes"
|
||||||
N = 500
|
N = 500
|
||||||
|
|
||||||
if not os.path.isdir('notes'):
|
if not os.path.isdir(folder):
|
||||||
os.mkdir('notes')
|
os.mkdir(folder)
|
||||||
|
|
||||||
imap = imaplib.IMAP4_SSL(imapserver)
|
imap = imaplib.IMAP4_SSL(imapserver)
|
||||||
imap.login(username, password)
|
imap.login(username, password)
|
||||||
|
@ -35,7 +36,7 @@ for i in range(messages, max(0, messages-N), -1):
|
||||||
|
|
||||||
print(str(i) + ' - ' + subject)
|
print(str(i) + ' - ' + subject)
|
||||||
filepath = subject + '.md'
|
filepath = subject + '.md'
|
||||||
filepath = os.path.join('notes', filepath)
|
filepath = os.path.join(folder, filepath)
|
||||||
|
|
||||||
if msg.is_multipart():
|
if msg.is_multipart():
|
||||||
for part in msg.walk():
|
for part in msg.walk():
|
||||||
|
|
Loading…
Reference in New Issue