I am using python as a shell and sending request to python in a loop but inside python script i am importing some package e.g. tensorflow, imutils etc and when python script boot for execution it's taking too much time(because its first importing all packages and then start execution), time for one import see below:
time python -c "import tensorflow.compat.v1"
real 0m2.680s
user 0m2.974s
sys 0m0.752s
and when this shell script is running in loop every time it is importing packages and doing processing, there is any way so that i can import all packages once and use again and again.
Note: For creating shell using https://www.npmjs.com/package/python-shell
Please help me if any one having solution.