如何在Ubuntu上使用Python创建文件快捷方式?
作为一个更好的定义,如何用Python写出下面这个函数呢?
def create_shortcut(source, dest):
create a shortcut of file 'source' and put it in 'dest'
1 个回答
3
如果你说的“快捷方式”是指符号链接(symlink),那其实就是这样:
import os
os.symlink(source,dest)