File Browser V1 (Python)

File Browser V1 (Python)

Currently looking through some of my older projects and seeing if any of my recent Python learning could be used to make them better. Possibly make the PDF merge idea better with some GUI driven fun rather than command line, and building on my previous GUI attempt. To do this I decided I would need a file explorer/file browser window.


#!/usr/bin/python3
# geektechstuff

# libraries to import
from tkinter import *
from tkinter import filedialog

# creates Tk window
root = Tk()

# hides the Tk window
root.withdraw()

# updates Tk window; without this the open file browser stays open
root.update()
file_to_open = filedialog.askopenfilename()

# currently used to display the file path/name to the selected file (making sure the file is selecting)
print(file_to_open)

#closes Tk window
root.destroy()


tkinter_open_file

One response to “File Browser V1 (Python)”

  1. PDF Merge – With GUI (Python) – Geek Tech Stuff Avatar

    […] I looked at using the tkinter module of Python to create a file browser GUI , and it has inspired me to relook at the PDF Merge program I did a while […]

    Like

Welcome to GeekTechStuff

my home away from home and where I will be sharing my adventures in the world of technology and all things geek.

The technology subjects have varied over the years from Python code to handle ciphers and Pig Latin, to IoT sensors in Azure and Python handling Bluetooth, to Ansible and Terraform and material around DevOps.

Let’s connect