

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 current directory using Python?
You can change directory or cd in Python using the os module. It takes as input the relative/absolute path of the directory you want to switch to.
For example
>>> import os >>> os.chdir('my_folder')
- Related Questions & Answers
- How to know/change current directory in Python shell?
- How to change the root directory of the current process in Python?
- How to change the permission of a directory using Python?
- How to change the owner of a directory using Python?
- How to know current working directory in Python?
- How to set the current working directory in Python?
- How to find current directory of program execution in Python?
- How to change the user and group permissions for a directory using Python?
- How to rename directory using Python?
- How to get a list of all sub-directories in the current directory using Python?
- How to create a directory using Python?
- How to remove a directory using Python?
- How to calculate a directory size using Python?
- How to create a directory recursively using Python?
- How to remove a directory recursively using Python?
Advertisements