Read In Directory Contents

Darrell news at dorb.com
Mon Jan 17 13:10:40 EST 2000


>>> import glob
>>> glob.glob('*.py')
['Mscomm32.py', 'comct332.py', 'except.py', 'dicMap.py', 'serial.py']

--
--Darrell
"Scott Billings" <aerogems at netins.net> wrote in message
> For a program I'm working on, it would be very useful if I could use an
> expression such as:
>
> list = os.getcwd() + "*.txt"
>
> to have the names of all text files in the current dir placed into the
> list. However, when I try this method, I get an error about no such file
> existing.
>





More information about the Python-list mailing list