About 590,000 results
Open links in new tab
  1. Easiest way to read/write a file's content in Python

    Jul 5, 2019 · In Ruby you can read from a file using s = File.read (filename). The shortest and clearest I know in Python is with open (filename) as f: s = f.read () Is there any other way to do …

  2. How to read HDF5 files in Python - Stack Overflow

    Jan 27, 2015 · I am trying to read data from hdf5 file in Python. I can read the hdf5 file using h5py, but I cannot figure out how to access data within the file. My code import h5py import numpy …

  3. Read file content from S3 bucket with boto3 - Stack Overflow

    Mar 24, 2016 · f.seek(0) is unnecessary with a BytesIO (or StringIO) object. read starts at the current position, but getvalue always reads from position 0.

  4. How should I read a file line-by-line in Python? - Stack Overflow

    Jul 19, 2012 · If iteration closed the file, I wouldn't be able to do that. So keeping iteration and resource management separate makes it easier to compose chunks of code into a larger, …

  5. Read a gzip file in Python - Stack Overflow

    Jun 1, 2024 · When I try to run this code; import gzip f=gzip.open('Onlyfinnaly.log.gz','rb') file_content=f.read() print file_content I get no output on the screen. How to read a gzip file …

  6. python - How to read pickle file? - Stack Overflow

    The following is an example of how you might write and read a pickle file. Note that if you keep appending pickle data to the file, you will need to continue reading from the file until you find …

  7. python - Reading JSON from a file - Stack Overflow

    If you are reading the data from the Internet instead, the same techniques can generally be used with the response you get from your HTTP API (it will be a file-like object); however, it is …

  8. audio - Reading *.wav files in Python - Stack Overflow

    Different Python modules to read wav: There is at least these following libraries to read wave audio files: SoundFile scipy.io.wavfile (from scipy) wave (to read streams. Included in Python 2 …

  9. Iterating over lines in a file python - Stack Overflow

    Jul 28, 2015 · The second case reads in the contents of the file into one big string. If you iterate over a string, you get each character in turn. If you want to get each line in turn, you can do …

  10. How can I parse a YAML file in Python - Stack Overflow

    Nov 23, 2015 · For your application, the following might be important: Support by other programming languages Reading / writing performance Compactness (file size) See also: …

Refresh