Answers for "# check if the file is not empty and get size"

0

# check if the file is not empty and get size

# check if the file is not empty and get size
import os
def is_empty_file(fpath):
  return os.path.isfile(fpath) and os.path.getsize(fpath) > 0

fp="/content/sample_data/california_housing_test.csv"

emp_status= is_empty_file(fp)
print(emp_status)
Posted by: Guest on March-26-2022

Code answers related to "# check if the file is not empty and get size"

Python Answers by Framework

Browse Popular Code Answers by Language