Computer Science Canada

Simple shortcut GUI app

Author:  QuantumPhysics [ Mon Oct 08, 2012 11:01 am ]
Post subject:  Simple shortcut GUI app

I made this last week during school hours, I wanted to make it easier to open websites in our school.
Since shortcuts are blocked and you must go through a certain process to open internet - This will just
skip that process and let me go to the website right away. It's a weird process (our IT guy is strange)

Without further ado, here is the code:


# Written by: QuantumPhyiscs
# Date Written: 10/03/12

# includes wxWidgets module
import wx
# includes web browser module to access internet
import webbrowser
# Copyright (c) ~ QuantumPhyiscs
class MyFrame(wx.Frame):
    def __init__(self):
        # Sets name of the frame
        wx.Frame.__init__(self, None, wx.ID_ANY, 'Open IE WP',
            pos=(300, 150), size=(207, 175))
        # Sets background color of the frame
        # Creates a button(1 - 4) at x-x pos, x-y size
        self.button1 = wx.Button(self, id=-1, label='Open Google',
            pos=(8, 8), size=(175, 28))
        self.button1.Bind(wx.EVT_BUTTON, self.button1Click)
        self.button2 = wx.Button(self, id=-1, label='Open Facebook',
            pos=(8, 38), size=(175, 28))
        self.button2.Bind(wx.EVT_BUTTON, self.button2Click)
        self.button3 = wx.Button(self, id=-1, label='Open Moodle',
            pos=(8, 68), size=(175, 28))
        self.button3.Bind(wx.EVT_BUTTON, self.button3Click)
        self.button4 = wx.Button(self, id=-1, label='Open Youtube',
            pos=(8, 98), size=(175, 28))
        self.button4.Bind(wx.EVT_BUTTON, self.button4Click)
        # Makes button visible on frame
    # Tackle events if button is clicked
    def button1Click(self,event):
        # Sets title or super's the frame once button is clicked
        self.SetTitle("Google is open.")
        # Opens default web browser and redirects to
        # Sets new = 1, which means thats a new window will open"",new = 1, autoraise = True)
        # Makes button visible on frame
        # repeats for the rest
    def button2Click(self,event):
        self.SetTitle("Facebook is open.")
      "",new = 1, autoraise = True)
    def button3Click(self,event):
        self.SetTitle("Moodle is open.")
    "",new = 1, autoraise = True)
    def button4Click(self,event):
        self.SetTitle("Youtube is open.")"",new = 1, autoraise = True)

application = wx.PySimpleApp()
window = MyFrame()
# While loop for application, continues untill window is closed to DESTROY app

Author:  QuantumPhysics [ Tue Oct 09, 2012 3:25 pm ]
Post subject:  Re: Simple shortcut GUI app

So I got many views of my code but no replies, what are your responses to my code? I need all the feedback I can get.