why cant i change directories in python? -
i'm trying change directories in python. first tried:
>>> os.getcwd()
and got:
traceback (most recent call last): file "<stdin>", line 1, in <module> nameerror: name 'os' not defined
i tried
>>> os.chir('/directory/i/want/to/change/to')
but still got
nameerror: name 'os' not defined
how define operating system?
you need import os module first:
import os os.getcwd()
Comments
Post a Comment