Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 17th, 2007, 12:02 PM   #11
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,791
Rep Power: 5 Sane will become famous soon enough
Re: Need your comments on a PyGTK PlayStation CD backup tool

Well, if you wanted to use it as a way to manage memory better, you could do something like this:

python Syntax (Toggle Plain Text)
  1. class my_application(object):
  2.  
  3. def __init__(self):
  4. """This function is called for each my_application instance initiated.
  5.  
  6. Do any window initiation here."""
  7.  
  8. self.my_widget = 0
  9. self.my_control = 1
  10. self.my_window = 2
  11. self.my_button = 3
  12. self.button_is_clicked = False
  13.  
  14. print "Window Opened"
  15.  
  16. def click_button(self):
  17. """This method could be called whenever the button in the window is clicked.
  18.  
  19. Do any button handling or response routines here."""
  20.  
  21. if self.button_is_clicked:
  22. print "Button is already clicked!"
  23. else:
  24. print "Button clicked!"
  25. self.button_is_clicked = True
  26.  
  27. if __name__ == '__main__':
  28.  
  29. my_program = my_application()
  30. my_program.click_button()
  31. my_program.click_button()
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Search grimpirate C 3 Jul 3rd, 2006 7:49 PM
Comments on comments stripper nnxion C 6 Apr 27th, 2006 9:53 AM
Backup Script :-) Pizentios Perl 18 Jan 12th, 2006 10:50 AM
interesting tool -- for webmasters? is it? H_two_O Coder's Corner Lounge 0 Oct 25th, 2005 7:26 PM
hey there.. need some comments! H_two_O Coder's Corner Lounge 1 Aug 27th, 2005 6:12 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:03 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC