MCPcopy Create free account
hub / github.com/geekcomputers/Python / file_input

Method file_input

ThirdAI/Terms and Conditions/TkinterUI.py:110–121  ·  view source on GitHub ↗

Open a file dialog to select a PDF file and display its name in the text box.

(self)

Source from the content-addressed store, hash-verified

108 return Font(size=size)
109
110 def file_input(self):
111 """
112 Open a file dialog to select a PDF file and display its name in the text box.
113 """
114 file_type = dict(defaultextension=".pdf", filetypes=[("pdf file", "*.pdf")])
115 file_path = filedialog.askopenfilename(**file_type)
116
117 if file_path:
118 self.path.append(file_path)
119 file_name = file_path.split("/")[-1]
120 self.text_box.delete(1.0, tk.END)
121 self.text_box.insert(tk.INSERT, file_name)
122
123 def clear_all(self):
124 """

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
deleteMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected