tar

how to iterate over a strict list of files with python to make a tar of them

how to iterate over a strict list of files with python to make a tar of them Question: using python3 (in a venv) I am looking for a way to save some files, each strictly defined as its own full pathname in a variable I would do something looking like this: import datetime import os …

Total answers: 1

How can I import words from a document into my python file?

How can I import words from a document into my python file? Question: [Pycharm] Hi, I am very new to programming and I wanted to make the Hangman game in python. I want to import words from the dictionary. In that way the computer chooses a random word, and the user have to guess it. …

Total answers: 1

can I read and write files in tar.gz without decompression?

can I read and write files in tar.gz without decompression? Question: PROBLEM OUTLINE: can we read and write files in tar.gz without decompression? I have many tar.gz files named like GF1_PMS1_E72.0_N33.6_20160507_L1A0001568810.tar.gz each of the tar.gz file contains the files like below: GF1_PMS1_E72.6_N33.6_20160511_L1A0001576267-MSS1.tiff GF1_PMS1_E72.6_N33.6_20160511_L1A0001576267-MSS1.xml GF1_PMS1_E72.6_N33.6_20160511_L1A0001576267-MSS1.rpb GF1_PMS1_E72.6_N33.6_20160511_L1A0001576267-MSS1.jpg I want to read the tiff to numpy array without …

Total answers: 2

How can I read tar.gz file using pandas read_csv with gzip compression option?

How can I read tar.gz file using pandas read_csv with gzip compression option? Question: I have a very simple csv, with the following data, compressed inside the tar.gz file. I need to read that in dataframe using pandas.read_csv. A B 0 1 4 1 2 5 2 3 6 import pandas as pd pd.read_csv(“sample.tar.gz”,compression=’gzip’) However, …

Total answers: 2

Read .tar.gz file in Python

Read .tar.gz file in Python Question: I have a text file of 25GB. so i compressed it to tar.gz and it became 450 MB. now i want to read that file from python and process the text data.for this i referred question . but in my case code doesn’t work. the code is as follows …

Total answers: 6

Python packaging: wheels vs tarball (tar.gz)

Python packaging: wheels vs tarball (tar.gz) Question: The advantage of wheels over eggs is clear (see section why not egg? https://pypi.python.org/pypi/wheel). However, it is not entirely clear to me what is the advantage of using wheels over tar.gz. I might be missing something obvious like “they are the same”. As I see it both can …

Total answers: 2

Read Contents Tarfile into Python – "seeking backwards is not allowed"

Read Contents Tarfile into Python – "seeking backwards is not allowed" Question: I am new to python. I am having trouble reading the contents of a tarfile into python. The data are the contents of a journal article (hosted at pubmed central). See info below. And link to tarfile which I want to read into …

Total answers: 4

How to construct a TarFile object in memory from byte buffer in Python 3?

How to construct a TarFile object in memory from byte buffer in Python 3? Question: Is it possible to create a TarFile object in memory using a buffer containing the tar data without having to write the TarFile to disk and open it up again? We get the bytes sent over a socket. Something like …

Total answers: 2

Python – mechanism to identify compressed file type and uncompress

Python – mechanism to identify compressed file type and uncompress Question: A compressed file can be classified into below logical groups a. The operating system which you are working on (*ix, Win) etc. b. Different types of compression algorithm (i.e .zip,.Z,.bz2,.rar,.gzip). Atleast from a standard list of mostly used compressed files. c. Then we have …

Total answers: 7