HiveBrain v1.2.0
Get Started
← Back to all entries
snippetpythonCriticalCanonical

How to set the current working directory?

Submitted by: @import:stackoverflow-api··
0
Viewed 0 times
directoryhowsetthecurrentworking

Problem

How to set the current working directory in Python?

Solution

Try os.chdir

import os
os.chdir(path)


        Change the current working directory to path. Availability: Unix, Windows.

Code Snippets

import os
os.chdir(path)

Context

Stack Overflow Q#1810743, score: 1074

Revisions (0)

No revisions yet.