【发布时间】:2012-08-04 07:43:21
【问题描述】:
我正在编写以下程序:
***import os
filepath=r'C:\TestData\openfolder.html'
abc=open(filepath,'w')
abc.writelines('<html><head></head><body>')
abc.writelines('<a href="os.startfile(filepath)">First Link</a>\n')
abc.writelines('</body></html>')***
我想要做的是,如果我在浏览器上单击第一个链接,我应该能够打开路径为“文件路径”的文件夹。 os.startfile 非常适合打开文件夹,但我不知道如何在某个链接中实现它。 谢谢。
【问题讨论】:
-
这个问题不会转给python。此外,最好明确指定您的操作系统,因为即使在不同的 Windows 版本上,解决方案也可能有所不同。
标签: html windows internet-explorer firefox google-chrome