Created
March 15, 2024 16:59
-
-
Save ChickenParmigiana/0e3c5ec2d798a109e519809290aa2b8f to your computer and use it in GitHub Desktop.
reporterkinder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter as tk | |
from tkinter import messagebox | |
# List of dimensions based on the schematic and report | |
dimensions = [ | |
"SH3/D3 Surface Finish 0.4um Ra", | |
"SH2/A7 2XØ6.00±0.25", | |
# ... add all other dimensions ... | |
] | |
# Function to show the filled report | |
def show_report(entries): | |
report = "" | |
for dimension, entry in entries.items(): | |
report += f"{dimension}: {entry.get()}\n" | |
messagebox.showinfo("Inspection Report", report) | |
# Here you can also save the report to a file if needed | |
# Setting up the main window | |
root = tk.Tk() | |
root.title("Inspection Report Filler") | |
entries = {} | |
# Creating input fields for each dimension | |
for dimension in dimensions: | |
frame = tk.Frame(root) | |
frame.pack(side=tk.TOP, fill=tk.X, padx=5, pady=5) | |
tk.Label(frame, text=dimension, width=30, anchor='w').pack(side=tk.LEFT) | |
entry = tk.Entry(frame) | |
entry.pack(side=tk.RIGHT, expand=tk.YES, fill=tk.X) | |
entries[dimension] = entry | |
# Submission button | |
submit_button = tk.Button(root, text='Show Report', command=lambda: show_report(entries)) | |
submit_button.pack(side=tk.BOTTOM, padx=5, pady=5) | |
# Run the GUI loop | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment