problem with listdir

castironpi at gmail.com castironpi at gmail.com
Sun Apr 27 06:46:05 EDT 2008


On Apr 27, 1:57 am, David <wizza... at gmail.com> wrote:
> On Sat, Apr 26, 2008 at 7:56 PM, jimgardener <jimgarde... at gmail.com> wrote:
>
> >  > * Run cmd.exe and see if you can run "dir f:\\code\\python\pgmgallery/*.*"
>
> >  that causes a message 'Invalid switch - "*.*".'
>
> Probably because on the command-line, / means a command-line option.
> Been a while since I used DOS.
>
> Try this instead:
>
> dir f:\code\python\pgmgallery\*.*"
>
> David.

Try typing listdir( '.' ), which is Windows for 'the current path
[being used]', at an interpreter.  listdir does not accept wildcards,
(surmisably since reg.exes are more powerful) and try ending with a
slash.




More information about the Python-list mailing list