Answers for "opeining file explorer using pyth"

1

open choose files from file explorer python

import tkinter as tk
from tkinter import filedialog

root = tk.Tk()
root.withdraw()

files = filedialog.askopenfilenames()
Posted by: Guest on December-12-2020
3

how to open file explorer in python

import os
import subprocess
FILEBROWSER_PATH = os.path.join(os.getenv('WINDIR'), 'explorer.exe')

def explore(path):
    # explorer would choke on forward slashes
    path = os.path.normpath(path)

    if os.path.isdir(path):
        subprocess.run([FILEBROWSER_PATH, path])
    elif os.path.isfile(path):
        subprocess.run([FILEBROWSER_PATH, '/select,', os.path.normpath(path)])
Posted by: Guest on May-26-2020

Python Answers by Framework

Browse Popular Code Answers by Language