import winshell
my_working
= "D:\\p\\s"
link_filepath
= "D:\\s.lnk"
with winshell
.shortcut
(link_filepath
) as link
:
link
.path
= my_working
或
import winshell
import pythoncom
path
= "D:\\s.lnk"
target
= "D:\\p\\s"
pythoncom
.CoInitialize
()
winshell
.CreateShortcut
(Path
=path
, Target
=target
)
或
参阅winshell homepage
或
import os
os
.symlink
("D:\\p\\s", "D:\\s")
转载请注明原文地址:https://tech.qufami.com/read-23778.html