Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check if a file is empty

import os
if os.stat("yourfile.extension").st_size == 0:
#note: file has to be in same directory as python script#
  print('empty')
 
PREVIOUS NEXT
Tagged: #python #check #file #empty
ADD COMMENT
Topic
Name
5+2 =