-
Notifications
You must be signed in to change notification settings - Fork 5
/
form.pyw
40 lines (28 loc) · 845 Bytes
/
form.pyw
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
39
__author__ = 'пользователь'
# -*- coding: utf-8 -*-
import Server
#from PySide import QtGui
import threading
import sys
import time
from tkinter import *
class AppGUI(object):
def __init__(self):
self.tk = Tk()
self.tk.geometry('100x50')
frame = Frame()
frame.pack()
Button(frame, text="Run Server", command = self.Startserv).pack(side = 'top')
Button(frame, text="Stop Server", command = self.Stopserv).pack(side = 'top')
def run(self):
self.tk.mainloop()
def Startserv(self):
threading.Thread(target=self.event).start()
def Stopserv(self):
threading.Thread(target=self.stop).start()
def event(self):
Server.serv.start_server()
def stop(self):
Server.serv.stop_server()
root = AppGUI()
root.run()