简体   繁体   中英

glob.glob does not return any files in a fully qualified path?

Note: the similarly named question Python glob.glob always returns empty list has different concrerns about relative pathname. Mine is a fully qualified path.

I am trying to list the files in a directory of the stanford dogs dataset:

$ls /data/stanforddogs/Annotation/n02097658-silky_terrier/* | wc -l
    183

Why is glob not finding these files

import glob
for f in glob.glob('/data/stanforddogs/Annotation/n02097658-silky_terrier/*'):
  print(f)

This returns no entries. Why is that? I am on macOS on python3.8

This appears to be a bug in the "Evaluate expression" feature of pycharm : nothing is found there. Running the same code within the "Execute selection within python console" does work.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM