import os cd / assert os.getcwd() == '/' %cd /tmp assert os.getcwd() == '/tmp'