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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -