[Tutor] Newbie question on passing a variable

FxItAL@aol.com FxItAL@aol.com
Sun, 20 Aug 2000 14:10:46 EDT


Hello All,

I've written the following to try and get input from the user. This works fine, my problem is passing it the variable InputMin in the other module - timer1.py.

from Tkinter import *

root = Tk()                                             
root.title('Top Level')                                 

e = StringVar()
global e
d = Entry(root, textvariable=e, width=10)
d.pack()                                                
var = e.get()

def z():
    var =  e.get()  
    import timer1
    timer1.TimeFunc(var)
f = Button(root, text='Print',command=z)
f.pack(side=RIGHT)        

root.mainloop()                                         

Thie timer1.py module:

def TimeFunc(var):
from time import *  
    me = time()
    you=localtime(me)
    ClockMin=you[4] #Represents Minute on Clock
    ClockHour=you[3] #Represents Hour on Clock
    InputMin=var
    InputHour=you[3]
    if ClockMin<InputMin:
        while ClockMin<InputMin or ClockHour<InputHour:             me = time()
            you=localtime(me)                                       ClockMin=you[4]
            ClockHour=you[3]
        print "great"

If I use only these two lines:

def TimeFunc(var):
    print var

it works.

I know this is alot to ask but any help will be greatly appreciated.

Thanks for your time, Al