当前位置:   article > 正文

python 创建桌面快捷方式_winshell.createshortcut

winshell.createshortcut

首先得安装 ActiveState ActivePython  . 因为这个中带了 winshell 库


  1. from os import path
  2. import winshell
  3. #----------------------------------------------------------------------
  4. def create_shortcut_to_desktop(target,title):
  5. """Create shortcut to desktop"""
  6. s = path.basename(target)
  7. fname = path.splitext(s)[0]
  8. winshell.CreateShortcut(
  9. Path = path.join(winshell.desktop(), fname + '.lnk'),
  10. Target = target,
  11. Icon=(target, 0),
  12. Description=title)



注:不支持win64

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/264775
推荐阅读
相关标签
  

闽ICP备14008679号