I can create a .tar.gz file using
with tarfile.open(archive, 'w:gz') as archive_fd:
add_files_to_tar('.', archive_fd)
and this works fine. But sometimes I want to print these files to stdout
(if I execute the command via SSH)
Does anyone have an idea how to do this? My old bash code is something like this
tar -czf - $files >&1
or
tar -czf - $files >/filename