couldnt you just import mod1 into your mod2? That way you could then access all methods.
Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
Well is ProgressBar inside a class in the module cause then you might have to go:
import mod1
mod1.class.ProgressBar()
Paul Thompson
Veteran Poster
1,119 posts since May 2008
Reputation Points: 264
Solved Threads: 183
why don't you just post Mod1 and Mod2, or attach them to your post ?
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
In principle, it should work if you put import Mod1 in Mod2. However this will fail if Mod1 imports Mod2, because there should be no cyclic importations in python code. There are ways around this. A solution could be to put the import statement in the function GetUserInfo
def GetUserInfo():
import Mod1
#Call Function ProgressBar present in Mod1
progress_bar = Mod1.clsMain(parent)
progress_bar.ProgressBar(20)
so that the import Mod1 will only be executed when GetUserInfo is called and not when Mod2 is imported.
I see in your code that frame1.py imports module2 and that module2.py imports frame1, and that's a bad idea :)
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691
There is an inconsistency in your code. The __init__ function in class Frame1 (which is called when you create a new Frame1 object) calls GetUserInfo which in turn creates a new Frame1 by a call to Frame1.Frame1. This gives an infinite loop.
Gribouillis
Posting Maven
2,786 posts since Jul 2008
Reputation Points: 1,044
Solved Threads: 691