tutorial
This commit is contained in:
parent
d980fdb944
commit
2b71586c04
8 changed files with 880 additions and 17 deletions
21
skeleton.py
Normal file
21
skeleton.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import network
|
||||
import tkinter as tk
|
||||
from tkinter import ttk
|
||||
import sys
|
||||
|
||||
listen_addr = ("0.0.0.0", 4444)
|
||||
send_addr = ("192.168.1.255", 4444)
|
||||
|
||||
sock = network.Sock()
|
||||
|
||||
root = tk.Tk()
|
||||
|
||||
def on_request(r):
|
||||
c, a = r
|
||||
print(c, a)
|
||||
|
||||
sock.listen(listen_addr, on_request)
|
||||
|
||||
sock.send({"message":"bonjour"}, send_addr)
|
||||
|
||||
root.mainloop()
|
||||
Loading…
Add table
Add a link
Reference in a new issue