-1

i have a question: i have many csv files in a folder and I need python to batch check file size. If file size is 17bytes, the file will be moved to a bad folder.

not sure how to check files size in a folder, and how to move files

Kun OuYang
  • 39
  • 2
  • 3
  • Possible duplicate of [How to check file size in python?](http://stackoverflow.com/questions/2104080/how-to-check-file-size-in-python) – derricw Apr 20 '17 at 16:55

1 Answers1

2

Import the 'os' package and use os.stat('your_file').st_size to get file size.

Justin Borromeo
  • 1,201
  • 3
  • 13
  • 26