

- 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 set the current working directory in 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 current working directory in Python?
- Get the Current Working Directory in Java
- How to display the current working directory in the Linux system?
- Java Program to Get Current Working Directory
- Find out the current working directory in C/C++
- How to change current directory using Python?
- 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 shell working directory in Linux?
- How to find current directory of program execution in Python?
- How to get the current username and directory in Golang?
- Internal working of Set in Python
- How to get a list of all sub-directories in the current directory using Python?
- How to set the current figure in Matplotlib?
- How to print full path of current file's directory in Python?
Advertisements