Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Python GUI open a file (filedialog) 📁
Play lesson

Python tkinter tutorial for beginners 🐍 - Python GUI open a file (filedialog) 📁

5.0 (2)
22 learners

What you'll learn

This course includes

  • 5.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

Python GUI filedialog tkinter open a file tutorial for beginners #Python #GUI #filedialog #tkinter #open #file #tutorial #beginners from tkinter import * from tkinter import filedialog def openFile(): filepath = filedialog.askopenfilename(initialdir="C:\\Users\\Cakow\\PycharmProjects\\Main", title="Open file okay?", filetypes= (("text files","*.txt"), ("all files","*.*"))) file = open(filepath,'r') print(file.read()) file.close() window = Tk() button = Button(text="Open",command=openFile) button.pack() window.mainloop()

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere