Open script

Skip Montanaro skip at mojam.com
Thu Feb 10 09:35:52 EST 2000


    Pedro> I'm trying to use OPEN to open a folder, because I need to get
    Pedro> the content of that folder.  This folder is in the filesystem.

Try os.listdir instead:

    >>> import os
    >>> os.listdir("/")
    ['lost+found', 'home', 'mnt', 'usr', 'dev', 'etc', 'tmp', 'var', 'proc', 'bin', 'boot', 'lib', 'root', 'sbin', '.bash_history']

Skip Montanaro | http://www.mojam.com/
skip at mojam.com | http://www.musi-cal.com/
"Languages that change by catering to the tastes of non-users tend not to do
so well." - Doug Landauer




More information about the Python-list mailing list