Linked Questions
15 questions linked to/from How to write a list of numbers as bytes to a binary file?
0
votes
1
answer
516
views
Basic examples with binary writing in python? [duplicate]
I am beginner with python. ASCII files I can create, but with binary it seems more difficult to get in.
The writing of binary files got me confused, when I have not been able to find simplest code ...
2
votes
2
answers
6k
views
How to convert a 8-bit number to an actual byte in Python?
Say I have 8 bits
01010101
which equals the byte
u
But I what I actually have is 8 binaries(well, integers). How do I convert these 8 binaries to the corresponding byte?
I'm trying
byte = int(...
0
votes
3
answers
4k
views
How can I effectively store binary data in a file that's in a text format like CSV?
I'm currently working on a password storage program in Python, though C would likely be faster. I've been trying for the past hour or so to find a way to store a bytes object in a CSV file. I'm ...
0
votes
1
answer
4k
views
How do I write binary data to a text file in Python?
I need to write text, then binary data to a file. For example, I would like to write the file with contents:
BESTFORMAT
NUMLINES 42
FIELDS FOO BAR SPAM
DATATYPES INT32 FLOAT64 FLOAT64
FILETYPE BINARY
...
3
votes
1
answer
2k
views
Passing a sequence of bits to a file python
As a part of a bigger project, I want to save a sequence of bits in a file so that the file is as small as possible. I'm not talking about compression, I want to save the sequence as it is but using ...
2
votes
1
answer
2k
views
Making lookup table in python, writing to a binary file that can be read in in a C program
I need to create a lookup table that can be used in an application where speed and efficiency are extremely important. The table will store time values, which are logarithmically distributed so that ...
2
votes
2
answers
2k
views
TypeError: an integer is required (got type str) on function join - python
I want to store foto data in file in python. But I get some strange characters in my file so this files does not open properly.
What I'm trying to do is remove this data from my array before save it ...
0
votes
2
answers
1k
views
Converting list of numbers to binary file
I have a very long list of large numbers in Python in the form
[429996711.2753906, 106845465.30664062, 47285925.673828125, 373352395.4082031, 934463030.1191406, 53994183.962890625, 455503649.6542969, ...
2
votes
1
answer
995
views
How to save web page's source
Hello i want save web page's source codes to any any text file and saving it C:\ folder.
I tried get web page's source with this code:
html = driver.page_source
print(html)
How to save page source to ...
1
vote
1
answer
965
views
How to view colored logs files?
I'm cusomizing logger module to add a few colors. Suppose I directed stream to a file as well. How can I read that file later? as in, which software shoud I use to read it properly as it seems to ...
1
vote
1
answer
865
views
How to create an new format of image?
I have read a lot of essays and articles about "Compressing Image Algorithm". There are a lot of algorithms but I can only understand some of them because I'm a student and I haven't gone to ...
2
votes
1
answer
459
views
.rpm file size increased (getting corrupted) during upload in python
I am uploading a .rpm file from my Django UI. I am able to upload the file successfully at the desired location..
Problem:
There is an increase in file size after uploading, and due to this I am ...
2
votes
1
answer
335
views
C#'s WriteAllBytes Equivalent Function in Python
I have an image saved as a bytes array in C#. Below would be an example of how you could create such an array:
byte[] image_bytes= new byte[100] {137, 80, 78, 71, ..., 130};
Note: The above is a ...
0
votes
1
answer
90
views
Read in delimited file column by colum with strict memory constraints
I need to write a python script that takes an existing file split into columns and rows, reads in each column, and outputs each column as a row in the output file. The file is a matrices of numbers, ...
1
vote
0
answers
72
views
Transferring array of bytes to python script
I am getting a json array which contains bytes of an image. This json array in embedded in json object. When checking the type of elements in this json array it is showing class 'str'.
I want to save ...