Skip to content

Instantly share code, notes, and snippets.

@webbedfeet
Created October 11, 2023 20:16
Show Gist options
  • Save webbedfeet/66814907dbb142e6b1d07217ebf5f7e8 to your computer and use it in GitHub Desktop.
Save webbedfeet/66814907dbb142e6b1d07217ebf5f7e8 to your computer and use it in GitHub Desktop.
Selectively adding files to a tar using Python glob
from pathlib import Path
import tarfile
with tarfile.open('data.tar','w') as tar:
for name in Path('.').glob('*/filtered_feature_bc_matrix.h5'):
tar.add(name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment