how to check if a file has data inside it python code example Example: python check if file has content >>> import os >>> os.stat("file").st_size == 0 True