Skip to Content
Tkinter GUI Application Development Blueprints, Second Edition - Second Edition
book

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

by Bhaskar Chaudhary
March 2018
Beginner to intermediate
422 pages
10h 33m
English
Packt Publishing
Content preview from Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Adding a single audio file

Adding a file involves asking for the location using Tkinter filedialog and updating the frontend and backend, as follows (see code 5.03view.py):

def add_audio_file(self): audio_file = tkinter.filedialog.askopenfilename(filetypes=[(       'All supported', '.mp3 .wav'), ('.mp3 files', '.mp3'),('.wav files', '.wav')]) if audio_file:   self.model.add_to_play_list(audio_file)   file_path, file_name = os.path.split(audio_file)   self.list_box.insert(tk.END, file_name)
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints

Tkinter GUI Application Development Blueprints

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788837460Supplemental Content