I was wondering if you could help me with my new python program. I recently added a browse button to the GUI to make things more "user-friendly." I told python to only accept *.pvt files when the user is asked to browse for a file... Now, I am left wondering how to tell python to take the path the user browsed to and open a cmd window[using subprocess.Popen("cmd.exe")] and cd to that user defined path.. any ideas???
-
1This question belongs on Stack Overflow, since it is specifically about programming.CarlF– CarlF2011-06-03 13:24:33 +00:00Commented Jun 3, 2011 at 13:24
-
2@jathanism Don't be a snob, particularly with new users.Eric Wilson– Eric Wilson2011-06-03 14:25:14 +00:00Commented Jun 3, 2011 at 14:25
-
please click the checkmark next to the most helpful answer to your questions, its a small way to thank those that help you.Eric Wilson– Eric Wilson2011-06-03 14:26:05 +00:00Commented Jun 3, 2011 at 14:26
Add a comment
|
1 Answer
subprocess.Popen() accepts a cwd argument:
Popen(["cmd.exe"], cwd=mypath)
2 Comments
user715578
hmm, still doesn't work... would there be a different way of opening a cmd window and cd'ing to that given directory?
grawity
@user: If an answer doesn't work, do not mark it as accepted; instead explain what exactly doesn't work. No
cmd.exe window? Wrong startup directory? Computer on fire?