[Solved] Import two modules with same name at top of PYTHONPATH elements

This import statement is incorrect: from utils.pkg2.mod2 import func2 If it has ever worked correctly, that was relying on resolving with the current working directory, implicit relative imports in Python 2.x, or a manually munged PYTHONPATH / sys.path. This is the type of import for which PEP8 said: Implicit relative imports should never be used … Read more

[Solved] How function is getting called without defining in python [closed]

Make sure your code is exactly as it is now in the question (including the edit by @Haidro) The code, as you pasted it in the question, suggests your indentation was something like this: def my_function(): ”’ docstring ”’ code_intended_for_my_function() #my_function() This would cause code_intended_for_my_function to be executed. This is “valid” because the docstring makes … Read more