dealing format from kindle to evernote

reference here

Finally, finish it, though it's not perfect. Hope it also helps you.

I had a reference from the link. Finishing this, it really saves me plenty of time.

What all I should do is:

Downloads my 'My Clippings.txt' from kindle

->Open my compiler and run the following code

->Copy it to my evernote

->Cool! 

#coding:utf-8

import os
print os.getcwd()
note_path=os.getcwd()+'/My Clippings.txt'
f=open(note_path,'r+')
digest_path=os.getcwd()+'/digest/'
os.mkdir(digest_path)
while True:
    onenote=[]
    for i in range(0,5):
        line=f.readline()
        if not line:
            exit()
        onenote.append(line+'==========')
        print onenote[0]
    book_note=open('%s%s.txt' %(digest_path,onenote[0].replace('=','')),'a+')
    book_note.write(onenote[3]+'\n')
    book_note.close()

猜你喜欢

转载自www.cnblogs.com/defoliate/p/9419639.html