tarfileimport tarfile tar = tarfile.open("sk_camera_6018.tar","w") tar.add(fullpath) tar.close()参考:https://www.cnblogs.com/liangqihui/p/9219333.html