Rahul
Rahul

Reputation: 11669

how does execfile() work in python?

does the file which is sent as an argument to execfile runs as an independent process / thread or is the code imported and then executed ? . Also i wanted to know how efficient is it compared to running threads / process .

Upvotes: 2

Views: 868

Answers (1)

Ned Batchelder
Ned Batchelder

Reputation: 375604

The file is not run in a separate thread or process, it runs synchronously with the caller.

Upvotes: 2

Related Questions