Python os.symlink() 方法

Python 教程 · 2019-02-04 11:57:42

概述

os.symlink() 方法用于创建一个软链接。

语法

symlink()方法语法格式如下:

os.symlink(src, dst)

参数

  • src -- 源地址。

  • dst -- 目标地址。

返回值

该方法没有返回值。

实例

以下实例演示了 symlink() 方法的使用:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

import os

src = '/usr/bin/python'
dst = '/tmp/python'

# 创建软链接
os.symlink(src, dst)

print "软链接创建成功"

执行以上程序输出结果为:

软链接创建成功

点击查看所有 Python 教程 文章: https://codercto.com/courses/l/8.html

查看所有标签

The Algorithm Design Manual

The Algorithm Design Manual

Steve S. Skiena / Springer / 1998-8-1 / GBP 53.91

Contents u Techniques u Introduction to Algorithms u Correctness and Efficiency u Correctness u Efficiency u Expressing Algorithms u Keeping Score u The RAM Model of Computatio......一起来看看 《The Algorithm Design Manual》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具