A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.tutorialspoint.com/python/os_symlink.htm below:

Python os.symlink() Method

Python os.symlink() Method

The Python method os.symlink() is used to create a symbolic link in the file system. The symlink is also known as soft link. It serves as a reference or pointer to another file or directory.

Syntax

Following is the syntax for os.symlink() method −

os.symlink(src, dest)
Parameters

The Python os.symlink() method accept two parameters, which are as follows −

Return Value

The Python os.symlink() method does not return any value.

Example

In the following example, we are creating a symbolic link using the symlink() method.

import os

src = "/home/tp/Python/Tutorials/tmpfile"
dst = "/home/tp/Python/tmpdir"

# This creates a symbolic link 
os.symlink(src, dst)
print ("symlink created")

On running the above program, it will create a symbolic link in /tmpdir directory.

symlink created

python_files_io.htm


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4