Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Common Directory Tasks

DZone's Guide to

Common Directory Tasks

·
Free Resource

>>> import os
>>> os.getcwd()
'C:\\lang\\python23'
>>> 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
Topics:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}