Skip to content

Instantly share code, notes, and snippets.

@webbedfeet
Created October 11, 2023 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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