2014-09-03 87 views

回答

0
#!/usr/bin/env python 
#-*- coding:utf-8 -*- 

import os 

link_name = 'linkname' 
file_name = './filename' 

# hard link 
cmd = 'ln ' + file_name + ' ' + link_name 
os.popen(cmd) 

# soft link 
cmd = 'ln -s ' + file_name + ' ' + link_name 
os.popen(cmd)