file_util_4.py 253 B

1234567
  1. def write_file_not_cover(file_path, file_content):
  2. father_dir = '/'.join(file_path.split('/')[0:-1])
  3. if not os.path.exists(father_dir):
  4. os.makedirs(father_dir)
  5. file_object = open(file_path, 'a')
  6. file_object.write(file_content)
  7. file_object.close()