0

I have written a simple and yet basic interface for an imaginary DVD Shop for learning Python with PyGTK. The current stage is at writing a simple user center.

When you execute this file, the first "Login + Logout" is acting correctly, but when you decide to login the second time with same/different account, it behaved as if it's still logged out, but the "Login" button has been changed to "Logout".

Code has been truncated to what's needed.

Please help me, I am new to Python and PyGTK. Thanks.

File link: http://pastebin.com/eK7z7S48

hlx98007
  • 241
  • 5
  • 15

1 Answers1

0

The problem is due to overwriting a class variable with an instance variable

If you are setting DVDshop.loggedIn instead of self.loggedIn your code will work as expected.

Community
  • 1
  • 1
bohrax
  • 1,051
  • 8
  • 20
  • Thanks. I have changed my code not using a logout/login button in this window, instead, I create a new graphical login interface. Thanks for your help though :) – hlx98007 Feb 07 '14 at 14:53