Python “show in finder”

前端 未结 4 1018
梦如初夏
梦如初夏 2020-12-31 10:51

How can I launch a new Finder window (or Explorer on Win) from python in a specific folder. The behaviour I\'m looking for is the equivalent of \"Show in finder\" link in a

4条回答
  •  半阙折子戏
    2020-12-31 11:43

    from subprocess import call
    targetDirectory = "~/Desktop"
    call(["open", targetDirectory])
    

提交回复
热议问题