Pete
Pete

Reputation: 449

Run python scripts one after another without any interruption

I am running some python files in Pycharm to read some data from excel files. There are a number of files running one after another. This is how I am doing it -

import A,B,C,D,E
A.main()
B.main()
C.main()
D.main()
E.main()

While one file is running there is some time after which the next file runs. During this time period if I click anywhere on the screen(editor/some other window) the execution gets stuck, I get no error, the execution just gets stuck. After this, I have to terminate and rerun it again. Is there a way I can resolve this? I don't want the execution to get stuck if I happen to click anywhere on the screen.

Also, all these files run correctly individually and together as long as I don't click anywhere on the screen until the execution ends.

Edit: I need the programs to run one after another and not at the same time since the output of the first program is required by the second and so on.

Upvotes: 0

Views: 264

Answers (1)

Azharul Islam Somon
Azharul Islam Somon

Reputation: 31

I may suggest you to use Thread. Which will help you to have different parts of your program run concurrently.

Upvotes: 1

Related Questions