From: albert kao on 13 May 2010 16:12 My program plan to use only files but ignore directories on Windows. I google but do not find some functions like bool isFile(string) bool isDirectory(string) Please help.
From: Jerry Hill on 13 May 2010 16:30 On Thu, May 13, 2010 at 4:12 PM, albert kao <albertkao3(a)gmail.com> wrote: > My program plan to use only files but ignore directories on Windows. > I google but do not find some functions like > bool isFile(string) > bool isDirectory(string) > Please help. You're looking for the functions os.path.isfile() and os.path.isdir() See http://docs.python.org/library/os.path.html for details. -- Jerry
From: James Mills on 13 May 2010 16:30 On Fri, May 14, 2010 at 6:12 AM, albert kao <albertkao3(a)gmail.com> wrote: > My program plan to use only files but ignore directories on Windows. > I google but do not find some functions like > bool isFile(string) > bool isDirectory(string) > Please help. Try looking up the os module. cheers James
|
Pages: 1 Prev: indexing lists/arrays question Next: Tkinter - paste from clipboard not working |