Forum Discussion

dhirendranaga's avatar
dhirendranaga
Occasional Contributor
9 years ago
Solved

How to verify that import in Python is successful

Have an import in a function that is called multiple times and this function is called only as required, sample is below.

 

def importTest()

  import time

  statement1

  statement2

 

def Test()

   importTest()

   importTest()

   importTest()

 

Does 'time'  module is imported per each call to function or only done in the first call and not in next two calls.

 

Please advise.

1 Reply