Current drive and directory

George Kinney gk_2345 at yahoo.com
Wed May 26 20:33:43 EDT 2004


"EAS" <eriksp at attbi.nospam.com> wrote in message
news:LP7tc.64476$gr.6380832 at attbi_s52...
> Does anyone know how to display the current directory using DOS
> and/or Python? I already tried os.pardir and os.curdir in Python, but all
> they return are
> a couple of periods...
>
> >>>import os
> >>>print os.curdir
> .
> >>>print os.pardir
> ..


maybe this?
import os
os.listdir(os.path.abspath('.'))

os maybe:
os.walk(os.path.abspath('.'))

???





More information about the Python-list mailing list