2015-08-02 23:44 GMT+02:00 Clayton Kirkwood <c...@godblessthe.us>:

>
>
> for dir_path, directories, files in os.walk(main_dir):
>     for file in files:
> #        print( " file = ", file)
> #       if( ("(\.jpg|\.png|\.avi|\.mp4)$") not in file.lower() ):
>
>
> I supppose you want to use regular expressions here and you are somehow
familiar with them but you forgot to tell Python to handle your string as
regex. This kind of expression must be matched against filenames instead of
using "in" operator.

In this case, https://docs.python.org/3/library/re.html and
https://docs.python.org/3/howto/regex.html are your friends.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to