t
This commit is contained in:
parent
89e46b317f
commit
2961d718e1
7
serial.py
Normal file
7
serial.py
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
'''Serialisation of data'''
|
||||||
|
import csv
|
||||||
|
|
||||||
|
with open('test.csv', newline='') as csvfile:
|
||||||
|
spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')
|
||||||
|
for row in spamreader:
|
||||||
|
print(', '.join(row))
|
26
ui.py
26
ui.py
@ -1 +1,27 @@
|
|||||||
import tkinter as tk
|
import tkinter as tk
|
||||||
|
|
||||||
|
|
||||||
|
class Application(tk.Frame):
|
||||||
|
def __init__(self, master=None):
|
||||||
|
super().__init__(master)
|
||||||
|
self.master = master
|
||||||
|
self.pack()
|
||||||
|
self.create_widgets()
|
||||||
|
|
||||||
|
def create_widgets(self):
|
||||||
|
self.hi_there = tk.Button(self)
|
||||||
|
self.hi_there["text"] = "Hello World\n(click me)"
|
||||||
|
self.hi_there["command"] = self.say_hi
|
||||||
|
self.hi_there.pack(side="top")
|
||||||
|
|
||||||
|
self.quit = tk.Button(self, text="QUIT", fg="red",
|
||||||
|
command=self.master.destroy)
|
||||||
|
self.quit.pack(side="bottom")
|
||||||
|
|
||||||
|
def say_hi(self):
|
||||||
|
print("hi there, everyone!")
|
||||||
|
|
||||||
|
|
||||||
|
root = tk.Tk()
|
||||||
|
app = Application(master=root)
|
||||||
|
app.mainloop()
|
||||||
|
Loading…
Reference in New Issue
Block a user