main.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:Nightchord 作者: theriley106 项目源码 文件源码
def ocrToDict(image=None, listofwords=[]):
    #image can be a list of files
    Words = {}
    if len(listofwords) == 0:
        PrintFail('You need to input a list of words')
        if 'y' in str(raw_input("Do you want to search for lyrics now? ")).lower():
            artist = raw_input("Artist: ")
            song = raw_input("Song: ")
            listofwords = GrabSongLyrics(artist, song)
            print(listofwords)
        else:
            return
    if isinstance(image, list) == False:
        image = PromptList('Which image/images to Scan: ', image)
    for i, image in enumerate(image):
        Words['Clean'][i] = imageToOCR(image, listofwords)
    with open('{}Transcript.json'.format(Words[1]), 'w') as f:
        json.dump(Words, f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号