How to open a windows folder when clicking on some link on a HTML page using Python

前端 未结 4 758
孤独总比滥情好
孤独总比滥情好 2021-01-06 05:38

I am writing following program :

***import os
filepath=r\'C:\\TestData\\openfolder.html\'
abc=open(filepath,\'w\')
abc.writelines(\'&         


        
4条回答
  •  情书的邮戳
    2021-01-06 06:26

    You can't. Clicking a link to a file in a browser will not launch the application associated with that file type on the OS. You can apparently do some funky stuff with JavaScript to launch particular filetypes with particular applications (see here: http://forums.devshed.com/asp-programming-51/launching-ms-word-to-open-file-from-a-hyperlink-55714.html) but apart from that the web browser is not the file browser.

提交回复
热议问题