Python os.chroot() Method with example

Syntax

os.chroot( path );

Return Value

Example

#!/usr/bin/pythonimport os, sys

# To set the current root path to /tmp/user
os.chroot("/tmp/usr")
print "Changed root path successfully!!"

Output

Changed root path successfully!!

--

--

--

A tutorial blog that provides tutorials on Web Design, Programming, Java Technologies, Mobile App Development, Database, Machine Learning, etc.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Best Practices for developing IoT Agents

System UI Hiding in Android

Reduce Cost and Increase Productivity with Value Added IT Services from buzinessware — {link} -

Using Notion To Boost Productivity As A Software Engineer

How to Install Kubernetes Ingress on a Raspberry Pi Cluster

Liskov Substitution Principle

TryHackMe Write-Up: Mindgames

A TicTacToe game in SwiftUI

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Web Design Tutorialz

Web Design Tutorialz

A tutorial blog that provides tutorials on Web Design, Programming, Java Technologies, Mobile App Development, Database, Machine Learning, etc.

More from Medium

[Python] Django development notes-setup and create apps

Basic Input and Operators in Python

The Python and Django conferences you don’t want to miss in 2022

How to Package Your Python Code