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

Common Command Line Equivalent In Python

DZone's Guide to

Common Command Line Equivalent In Python

· ·
Free Resource
>>> 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:

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}