Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> Python

Cách đặt current working directory trong Python?


Thay đổi thư mục (cd) trong Python dùng module os. Nhận input đường dẫn tương đối/tuyệt đối thư mục muốn chuyển.

Ví dụ

>>> import os
>>> os.chdir('my_folder')