Created
October 11, 2023 20:16
-
-
Save webbedfeet/66814907dbb142e6b1d07217ebf5f7e8 to your computer and use it in GitHub Desktop.
Selectively adding files to a tar using Python glob
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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