Python pyinstaller execution questions

Asked 2 years ago, Updated 2 years ago, 17 views

Hello, everyone pyinstaller has a problem with compiling and running, so I'm asking you a question

def main():
    while True:
        start_time = time.time()
        pool = Pool(2)
        pool.map(GetPage, range(1,b+1)) 
        pool.close()
        pool.join()
        print("--- %s seconds ---"%(time.time() - start_time)))

if __name__ == '__main__':
     main()

I had to import page information repeatedly like this, so I had to repeat it with while When running in Visual Studio Code The pool disappears as you want, and works well. When you compile and run it, pool appears as infinite and the computer stops What is the problem?

python

2022-09-20 11:01

1 Answers

if_name_=='_main_':
    Freeze_support() <<< You have to write this down!
    main()


2022-09-20 11:01

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.