os.path.walk() to get full path of all files

Jussi Piitulainen jpiitula at ling.helsinki.fi
Thu Mar 17 05:09:07 EDT 2011


Laurent Claessens writes:

> > file_list = []
> > for root, _, filenames in os.walk(root_path):
> >       for filename in filenames:
> >           file_list.append(os.path.join(root, filename))
> 
> What does the notation "_" stands for ? Is it a sort of /dev/null ?

   >>> x, _, y = 1, "hukairs", 3
   >>> x, y
   (1, 3)
   >>> _
   'hukairs'
   >>> 



More information about the Python-list mailing list