Empty file detection

Purpose: When converting a file (for example, csv file) accumulated in an arbitrary folder into a dataframe with python, an error may occur if there is an empty file with no contents, so a preventive measure for that.

sample.py


import os
if os.path.getsize(file_path):
   (write a process...)

Recommended Posts

Empty file detection
File matching
TFRecord file creation memorandum for object detection
File creation
Read file
File operations
[Python] [chardet] Automatic detection of character code of file