Skip to content Skip to sidebar Skip to footer
Showing posts with the label File Io

How To Open And Read Lzma File In-memory

I have a giant file, let's call it one-csv-file.xz. It is an XZ-compressed CSV file. How can I … Read more How To Open And Read Lzma File In-memory

Advice With A File Program Asking For The Largest Number

the assignment this time around deals with using files. 'Assume that a file containing a series… Read more Advice With A File Program Asking For The Largest Number

Python - How To Check If A File Is Used By Another Application?

I want to open a file which is periodically written to by another application. This application can… Read more Python - How To Check If A File Is Used By Another Application?

How To Count The Total Number Of Lines In A Text File Using Python

For example if my text file is: blue green yellow black Here there are four lines and now I want t… Read more How To Count The Total Number Of Lines In A Text File Using Python

Python Basics - Request Data From Api And Write To A File

I am trying to use 'requests' package and retrieve info from Github, like the Requests doc … Read more Python Basics - Request Data From Api And Write To A File

Closing A File After Using Np.load (using Spyder)

I am loading a file: a= np.load('myfile.npz') and then doing things with a After a while I… Read more Closing A File After Using Np.load (using Spyder)

How To Save Big (not Huge) Dictonaries In Python?

My dictionary will consist of several thousand keys which each key having a 1000x1000 numpy array a… Read more How To Save Big (not Huge) Dictonaries In Python?

To_csv() And Read_csv() For Dataframe Containing Serialized Objects

I have proved that the storing and retrieving of a serialized object from the cell of a pandas data… Read more To_csv() And Read_csv() For Dataframe Containing Serialized Objects

Truncate File With A Path Relative To A Directory/file Descriptor?

Many methods of the os module (see documentation) support paths relative to file descriptors (dir_f… Read more Truncate File With A Path Relative To A Directory/file Descriptor?

How To Write Every Other Line In A Text File?

inputFile = open('original_text.txt','r') outputFile = open('half_text.txt'… Read more How To Write Every Other Line In A Text File?

Writing Huge Strings In Python

I have a very long string, almost a megabyte long, that I need to write to a text file. The regular… Read more Writing Huge Strings In Python

Python Os Module Open File Above Current Directory With Relative Path

The documentation for the OS module does not seem to have information about how to open a file that… Read more Python Os Module Open File Above Current Directory With Relative Path

Writing With Python's Built-in .csv Module

[Please note that this is a different question from the already answered How to replace a column us… Read more Writing With Python's Built-in .csv Module

Python Reading From File Into Multiple Lists

I don't suppose someone could point me in the right direction? I'm a bit wondering how best… Read more Python Reading From File Into Multiple Lists

Python Searching For String And Printing The File It Is In

I am working on a small program for work, and I have looked everywhere for help on this! What I'… Read more Python Searching For String And Printing The File It Is In

How To Bypass Memory Error When Replacing A String In A Large Txt File?

I have several files to iterate through, some of them several million lines long. One file can have… Read more How To Bypass Memory Error When Replacing A String In A Large Txt File?

Getting A Matlab Code's Results On Python

I have code in matlab whose results I would like to use in python code (as a matrix or as a .dat fi… Read more Getting A Matlab Code's Results On Python

How To Append Data To Text File In Python 2.7.11?

Could any one show me how i can add hyperlinks to new line in text file? If there is already data i… Read more How To Append Data To Text File In Python 2.7.11?

Pypdf's Pdffilereader() Having Problems Reading File, File Not Callable

So here is my import: from pyPdf import PdfFileWriter, PdfFileReader Here is were I write my pdf: … Read more Pypdf's Pdffilereader() Having Problems Reading File, File Not Callable

File Modification And Creation

How would you scan a dir for a text file and read the text file by date modified, print it to scree… Read more File Modification And Creation