如何在Python中执行“ cd”操作?

您可以使用os模块在Python中更改目录或cd。它以您要切换到的目录的相对/绝对路径作为输入。

例如

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