i'm learning python, and i'm bit stuck...
This is my code:
# TESTING FILE
import os
import subprocess
from pathlib import Path
# VAR
name = 'my_random_dir'
# Main
path2 = str(Path(__file__).parent.absolute())
var = path2 + "/" + name
print(var)
subprocess.Popen(r'explorer /select "{var}"')
I would like open a directory inside the folder script, that is generated automatically (that would like mean, i can not know the name of this folder previusly and i need to link it from the variables)
I have tried some stuff like the code above, but i didn't found the solution ... is there any way for open a folder in Windows Explorer, when you don't know the name of the folder and you need to take it from variables?
This script only launch Windows Explorer and ignore my path ... is there any syntax error ? Am i approaching it bad?