0

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???

3
  • 1
    This question belongs on Stack Overflow, since it is specifically about programming. Commented Jun 3, 2011 at 13:24
  • 2
    @jathanism Don't be a snob, particularly with new users. Commented 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. Commented Jun 3, 2011 at 14:26

1 Answer 1

2

subprocess.Popen() accepts a cwd argument:

Popen(["cmd.exe"], cwd=mypath)
Sign up to request clarification or add additional context in comments.

2 Comments

hmm, still doesn't work... would there be a different way of opening a cmd window and cd'ing to that given directory?
@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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.