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