1

I have a large python script that I broke up into a main file and 5 smaller python files with functions that are called from the main file. However, I find that I need to import the same python packages/ libraries (e.g json, flask, csv, ...etc) in many of the smaller files. I.e many of the files start with the same “import json, csv,...etc’ command. My question is does importing the same package across the python files slow down performance in a material way? Or would python load the library the first time it encounters it in memory and then just use it for the other files if it is called ?

Mad Physicist
  • 107,652
  • 25
  • 181
  • 264
Melogs
  • 95
  • 6

0 Answers0