Spyder: different results depending on if I run code with F5 or F9

邮差的信 提交于 2019-12-24 15:56:23

问题


I've got different results while trying to run the same following code:

    import PyPDF2, pdfplumber, re, pandas, sys, os, time, glob
    import numpy as np
    from read_pdf_function import *
    from os import listdir
    from os.path import isfile, join
    from time import gmtime, strftime,localtime
    from multiprocessing import Pool

    path=glob.glob('SFCR\*.pdf') 
    with Pool(8) as p: 
            fPage = p.map(find_data, path) 
    print(fPage)

(find_data is a function that I wrote in read_pdf_function, it returns the first page with data of a pdf)

-If I run the file pressing the F5 key, the script returns nothing and just keeps runing.

-If I run selecting the whole code then pressing F9, the script returns the values I'm looking for.

I've never been in front of this case. What can be done to let code be executed in both ways?

Thanks in advance!

来源:https://stackoverflow.com/questions/55952689/spyder-different-results-depending-on-if-i-run-code-with-f5-or-f9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!