I have this code:
allFiles = os.listdir(myPath)
for module in allFiles:
    if 'Module' in module: #if the word module is in the filename
        dirToScreens = os.path.join(myPath, module)    
        allSreens = os.listdir(dirToScreens)
Now, all works well, I just need to change the line
allSreens = os.listdir(dirToScreens)
to get a list of just files, not folders. Therefore, when I use
allScreens  [ f for f in os.listdir(dirToScreens) if os.isfile(join(dirToScreens, f)) ]
it says
module object has no attribute isfile
NOTE: I am using Python 2.7
 
     
     
    