[K12OSN] python help

cliebow at downeast.net cliebow at downeast.net
Mon Apr 18 13:36:11 UTC 2005


any snakers out there willing to teach  a little python? simply need to
execute a command by pushing a button..using os.system..brain is fried from
googling this..chuck

#!/usr/bin/python     
#import os, Tkinter
#import string 
from Tkinter import *
from os import *
#from sys import *
#dir(os)

class Application(Frame):              
    def __init__(self, master=None):
        Frame.__init__(self, master)   
        self.grid()                    
        self.createWidgets()
 self.createWidgets2()
 self.createWidgets3()
 self.createWidgets4()

    def createWidgets(self):
        self.quitButton = Button ( self, text="Install RPMS", fg="white",
            command=self.wooha)        
        self.quitButton.grid() 

    def createWidgets2(self):
 self.quitButton = Button ( self, text="Add an entire new ldap directory",
fg="red" , 
            command=self.wooha2)
 self.quitButton.grid()

    def createWidgets3(self):
 self.quitButton = Button ( self, text="Install from csvfiles", fg="blue" , 
            command=self.wooha3)
 self.quitButton.grid()

    def createWidgets4(self):
 self.quitButton = Button ( self, text="Install Single User", fg="green" , 
            command=self.wooha4)
 self.quitButton.grid()

    def wooha(self):
 #cmd="/usr/bin/freecell"
 os.system("echo done")
 #print "Hey"        

    def wooha2(self):
 print "Ho"

    def wooha3(self):
 print "Hee"

    def wooha4(self):
 print "Ha!"

app = Application()                    
app.master.title("ldapadmin") 
app.mainloop()                   


---------------------------------------------
This message was sent from Downeast.Net.
http://ellsworthme.com/





More information about the K12OSN mailing list