I want to change the starting position of the explorer to Python.

Asked 2 years ago, Updated 2 years ago, 65 views

Coding with Python

def explorer():

 subprocess.call('explorer')

Run the explorer with the The path of the file depends on what you choose, so it is difficult to set the path with an absolute value

path=os.path.dirname(file) 

Obtain the file path to the

I want to specify the first location of the explorer as path.

What should I do at times like this?

python explorer

2022-09-22 18:19

1 Answers

If you search , maybe...?

def explorer():
    path = str(os.path.dirname(file))
    subprocess.Popen("explorer " + path)


2022-09-22 18:19

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.