python check if file exists and is not empty