__author__ = 'jsgreenwell' import pygtk pygtk.require('2.0') #This loads all the base classes and functions for python (saves time) #May switch to 3.0 at later date; 2.0 for setup and testing due to familiarity import gtk """ Will start by just calling class within this program, will then change to full module for importing """ class RegisterBase: """ Base class for GUI elements """ def __init__(self): """ Sets up a Top Level Window through Gtk """ self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.show() def main(self): """ Calls main method in Gtk which loads the main (Top Level) window """ gtk.main() print __name__ if __name__ == "__main__": base = RegisterBase() base.main()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question