Change Dir : Dircetories « File « Python






Change Dir


import os

os.chdir('/server/accesslogs')

#Be sure to use the "import os" style instead of "from os import *". This will keep 
#os.open() from shadowing the builtin open() function which operates much 
#differently.



           
       








Related examples in the same category

1.Listing DirectoriesListing Directories
2.Listing Directories with glob
3.Working with DirectoriesWorking with Directories