Download showcase_scenes/dialog.py from hkblockchaintechnology/tiny-computer-agent: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/hkblockchaintechnology/tiny-computer-agent/resolve/main/showcase_scenes/dialog.py
- Command line
-
hf download hf://hkblockchaintechnology/tiny-computer-agent/showcase_scenes/dialog.py
-
curl -L -o dialog.py https://huggingface.co/hkblockchaintechnology/tiny-computer-agent/resolve/main/showcase_scenes/dialog.py
819 Bytes
| import pathlib | |
| import tkinter as tk | |
| MARKER = pathlib.Path(r"__MARKER__") | |
| READY = pathlib.Path(str(MARKER) + ".ready") | |
| root = tk.Tk() | |
| root.title("Document") | |
| root.geometry("420x230+120+120") | |
| root.configure(bg="#f5f6f8") | |
| title = tk.Label(root, text="Untitled document - unsaved changes", bg="#f5f6f8") | |
| title.place(x=20, y=18) | |
| tk.Label(root, text="File name", bg="#f5f6f8").place(x=20, y=70) | |
| entry = tk.Entry(root) | |
| entry.place(x=20, y=95, width=300, height=28) | |
| entry.insert(0, "report.txt") | |
| buttons = [] | |
| def chosen(): | |
| MARKER.write_text("Save") | |
| title.config(text="Saved to disk") | |
| for widget in buttons: | |
| widget.place_forget() | |
| buttons.append(tk.Button(root, text="Save", command=chosen)) | |
| buttons[0].place(x=20, y=155, width=110, height=40) | |
| root.update() | |
| READY.write_text("mapped") | |
| root.mainloop() | |