Over a million developers have joined DZone.

Common Command Line Equivalent In Python

·
>>> import os

>>> os.getcwd()     # get current working directory
'C:\\lang\\python23'

>>> os.chdir('C:/')  # change directory
>>> os.chdir('lang')  # again

>>> os.listdir('.')  # list
['dotnet', 'try', 'editplus', 'python23', 'leo', 'mingw', 'perl', 'gtk', 'ironpy', 'java142']
>>> 
Topics:

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

{{ parent.tldr }}

{{ parent.urlSource.name }}