![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to change the root directory of the current process in Python?
You can use the os.chroot to change the root directory of the current process to path. This command is only available on Unix systems. You can use it as follows:
>>> import os >>> os.chroot('/tmp/my_folder')
This changes the root directory of the script running to /tmp/my_folder.
Advertisements