Background
I am working on a basic text editor, and need to use Windows Explorer to get the path of a file. This is my code currently, but it simply opens the file - I need it to return the path as a string:
import subprocess
subprocess.Popen(r'explorer /select, "C:\"')
Question(s)
- How would I have it return the path as a string?
- How would I use the path to access a specific file? For instance, if I wanted to open file
myFile
, but it wasn't in the same folder as my program, how would I have it access that file, in a different folder? Sorry for the ambiguity!
Tech Specs
OS: Windows 7
Language: Python 2.7.3