As a better definition, how to write the following function in Python ?

def create_shortcut(source, dest):
    create a shortcut of file 'source' and put it in 'dest'
有帮助吗?

解决方案

If by "shortcut" you mean symlink, it's just

import os

os.symlink(source,dest)
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top