1、判断是否是zip文件

#!/usr/bin/env python3
# encoding: utf-8

import zipfile

filenames = ['tcp_server.py', 'test.py', 'test.zip']

for filename in filenames:
    print('{:>15}  {}'.format(filename, zipfile.is_zipfile(filename)))
zipfile_is_zipfile.py

相关文章:

  • 2021-06-18
  • 2021-11-14
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-07-02
  • 2022-02-12
  • 2021-11-21
  • 2021-06-24
  • 2022-01-14
相关资源
相似解决方案