Hello!

Before I tell you about my problems, I ask for your consideration as I am a 
newbie at python...

I was having problems as I tried to open another program within a program (both 
programs are Tkinter UIs)

As for the reference, here is my code:


#program: realprogram.py
from Tkinter import *                                    #Imports the Tkinter 
module
import os

def showtime():
    os.system("clock.py")

window = Tk()
frame = Frame(window)
frame.pack()

clock_command = lambda : showtime()
b3 = Button(frame, text="What time is it?", command=clock_command)
b3.pack()

window.mainloop()



And the following code is the clock.py:

#program: clock.py
import Tkinter
import time

currenttime = ''
clock = Tkinter.Label()
clock.pack()

def tick():
    global currenttime
    newtime = time.strftime('%H:%M:%S')
    if newtime != currenttime:
        currenttime = newtime
        clock.config(text=currenttime)
    clock.after(200, tick)

tick()
clock.mainloop()




I know for certain that the "clock.py" works (because i got it from the web.. 
-_-;;)

but I'm having a real difficulty trying to open clock.py through my real 
program....

I know you're busy and everything, but I REALLY hope you can help me soon... 

_________________________________________________________________
Create a cool, new character for your Windows Liveā„¢ Messenger.
http://go.microsoft.com/?linkid=9656621
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to