Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Common directory tasks (See related posts)

   1  
   2  >>> import os
   3  >>> os.getcwd()
   4  'C:\\lang\\python23'
   5  >>> os.listdir('C:/lang')
   6  ['editplus', 'python23', 'perl', 'ironpy', 'java142', 'processing']
   7  >>> os.chdir('C:/')
   8  >>>

This is eqivalent to common task on command line
- Show current directory
- List content in a directory
- Change directory

You need to create an account or log in to post comments to this site.


Click here to browse all 5551 code snippets

Related Posts