I have a function that checks the files and directories in this function and returns a tuple of lists, for example addedFiles, removedFiles, addedDirs, removedDirs. Each of the named subscriptions in the tuple will be a list of strings (or empty). I need to add the results returned by the function to local versions of these lists.
This highly modified one demonstrates the result that I get after:
addedFiles, removedFiles, addedDirs, removedDirs = [],[],[],[]
for dir in allDirs:
a,b,c,d = scanDir( dir )
addedFiles.extend( a )
removedFiles.extend( b )
addedDirs.extend( c )
removedDirs.extend( d )
But, I want to know if there is a better way to execute a section inside a loop for?
It's as if it's just a little ... ugly.
source
share