开发者

cd to user defined path in python

开发者 https://www.devze.com 2023-03-10 00:47 出处:网络
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 us

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 bro开发者_JAVA技巧wsed to and open a cmd window[using subprocess.Popen("cmd.exe")] and cd to that user defined path.. any ideas???


subprocess.Popen() accepts a cwd argument:

Popen(["cmd.exe"], cwd=mypath)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号