Os Symlink
# Python2.x Python os.symlink() Method
[ Python OS File/Directory Methods](#)
* * *
### Overview
The os.symlink() method is used to create a symbolic link.
A symbolic link is a special type of file that contains a reference to another file or directory, and can point to a different location in the file system.
### Syntax
The syntax for the **symlink()** method is as follows:
os.symlink(src, dst)
### Parameters
* **src** -- The path to the target file or directory for which the symbolic link is to be created.
* **dst** -- The path and name of the symbolic link.
### Return Value
This method does not return a value.
### Example
The following example demonstrates the use of the symlink() method:
## Example
#!/usr/bin/python# -*- coding: UTF-8 -*-import os src = '/usr/bin/python'dst = '/tmp/python'# Create a symbolic link os.symlink(src, dst)print"Symbolic link created successfully"
Executing the above program outputs the following:
Symbolic link created successfully
[ Python OS File/Directory Methods](#)
YouTip