-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathshow.py
More file actions
38 lines (27 loc) · 707 Bytes
/
Copy pathshow.py
File metadata and controls
38 lines (27 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# coding=utf-8
import time
import threading
from Tkinter import *
class MyThread(threading.Thread):
def __init__(self, my_win):
threading.Thread.__init__(self)
self.my_win = my_win
def run(self):
time.sleep(5)
self.my_win.destroy()
def index():
print 'hello world'
def show(url):
win = Tk()
win.title('图片url')
win.geometry('600x40')
btn = Button(win, text='复制', command=index)
btn.pack(sid=RIGHT)
text = Text(win)
text.insert(INSERT, url)
text.pack(sid=LEFT)
temp = MyThread(win)
temp.start()
win.mainloop()
if __name__ == '__main__':
show('http://www.runoob.com/python/python-gui-tkinter.html')