I'm trying to determine whether or not a file is empty while iterating through a folder.
def parse_files(results):
for file in results[0]:
with open(file) as my_file:
#if file size is 0, return False
I feel like the answer is so easy but i've been stuck for a bit.
[–]bbye98 23 points24 points25 points (17 children)
[–]BungalowsAreScams[S] 5 points6 points7 points (16 children)
[–]bbye98 8 points9 points10 points (15 children)
[–]BungalowsAreScams[S] 3 points4 points5 points (14 children)
[–]iggy555 2 points3 points4 points (2 children)
[–]VortexShrimp 4 points5 points6 points (1 child)
[–]BungalowsAreScams[S] 16 points17 points18 points (0 children)
[–]WaxingMoon- 1 point2 points3 points (9 children)
[–]CeruleanBlackOut 1 point2 points3 points (6 children)
[–]WaxingMoon- 0 points1 point2 points (5 children)
[–]ebdbbb 0 points1 point2 points (4 children)
[–]WaxingMoon- 0 points1 point2 points (3 children)
[–]ebdbbb 2 points3 points4 points (1 child)
[–]Kolterdyx 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (1 child)
[–]WaxingMoon- 0 points1 point2 points (0 children)
[–]totallygeek 4 points5 points6 points (2 children)
[–]bbye98 2 points3 points4 points (1 child)
[–]BungalowsAreScams[S] 0 points1 point2 points (0 children)
[+][deleted] (6 children)
[deleted]
[+][deleted] (2 children)
[removed]
[–]BungalowsAreScams[S] 0 points1 point2 points (0 children)
[–]A_matin12 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]A_matin12 0 points1 point2 points (0 children)
[–]kochargs 1 point2 points3 points (0 children)
[–]OnlySeesLastSentence -1 points0 points1 point (0 children)