Over a million developers have joined DZone.

Common Directory Tasks

DZone's Guide to

Common Directory Tasks

Free Resource

>>> import os
>>> os.getcwd()
>>> os.listdir('C:/lang')
['editplus', 'python23', 'perl', 'ironpy', 'java142', 'processing']
>>> os.chdir('C:/')

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

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}