filehandle
Normalize the way you get file handle from either gzip or normal file
Typical way to open gzip or regular file
>>> import gzip
>>> import os.path
>>> files = ['/path/to/foo.bar.gz', '/path/to/foo.bar']
>>> for f in files:
... root, ext = os.path.splitext(f.replace('.gz',''))
... ext = ext[1:]
... if f.endswith('.gz'):
... handle = gzip.open(f)
... else:
... handle = open(f)
Using filehandle
>>> import filehandle
>>> files = ['/path/to/foo.bar.gz', '/path/to/foo.bar']
>>> for f in files:
... handle, extension = filehandle.open(f)
Release files for filehandle 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| filehandle-0.0.9.tar.gz | 1.6 kB | Details |
Release files / filehandle-0.0.9.tar.gz
| Download URL | filehandle-0.0.9.tar.gz |
|---|---|
| Size | 1.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99c966fe0c4df486759799264b2a4c0b84763f1674dec6c5e6d8a3e11f004077
|
|
BLAKE2b-256 checksum How to use checksums |
54ec1a6385184b6fc512b62ace58cc4446bdc1b5a693f93157edd030ad3125b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |