class ToDeskHandler(BaseHandler):
def get(self):
content = '''[InternetShortcut]
URL=http://idealclub.sinaapp.com
IDList=
IconFile=http://idealclub.sinaapp.com/favicon.ico
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2'''
self.set_header("Content-Type","application/octet-stream")
self.set_header("Content-Disposition","attachment; filename=饭否.url")
self.write(content)
1.请将favicon.ico文件放置在网站根目录下。2.用ie访问网站,将图标缓存至本地。
这样就可以在快捷方式上显示网站图标了。
本文介绍了一种使用Python Web框架生成桌面快捷方式(.url文件)的方法,并提供了具体实现代码。通过此方法,用户可以轻松地在桌面上创建指向特定网址的快捷方式,同时显示网站的图标。
580





