Python: I need to understand better imports and packages?

Took me a while to read through all that code, but it looks like your problem is in pkg2/mod2.py. The line foo = basemod. Get_msg() is executed the first time that file is imported, and never again.So by the time you change the value of mod1.

Bar this has already executed, and foo is None The solution should simply be to move that line into the print_foo function, so it is only executed when that function is called - which is after the code that sets the relevant value.

Took me a while to read through all that code, but it looks like your problem is in pkg2/mod2.py. The line foo = basemod. Get_msg() is executed the first time that file is imported, and never again.So by the time you change the value of mod1.

Bar, this has already executed, and foo is None. The solution should simply be to move that line into the print_foo function, so it is only executed when that function is called - which is after the code that sets the relevant value.

You are perfectly right, I was so convinced that it had to be a problem with imports that I was completely ignoring that line. Thank you so much! – kynikos Aug 12 at 14:54.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions