Skip to content

Magenaut

  • Home
  • Topics
    • Notes
    • Tutorial
    • Bug fixing
    • Extension
    • Server
  • Q&A
  • Privacy Policy
  • About

binary

Converting integer to binary in python

August 19, 2022 by Magenaut

In order to convert an integer to a binary, I have used this code :

Categories Python, Q&A Tags binary, integer, python Leave a comment

Flask to return image stored in database

August 18, 2022 by Magenaut

My images are stored in a MongoDB, and I’d like to return them to the client, here is how the code is like:

Categories Python, Q&A Tags binary, flask, python Leave a comment

Binary representation of float in Python (bits not hex)

August 18, 2022 by Magenaut

How to get the string as binary IEEE 754 representation of a 32 bit float?

Categories Python, Q&A Tags binary, floating-point, python Leave a comment

How to convert ‘binary string’ to normal string in Python3?

August 18, 2022 by Magenaut

For example, I have a string like this(return value of subprocess.check_output):

Categories Python, Q&A Tags binary, python, python-3.x, string Leave a comment

Convert to binary and keep leading zeros

August 18, 2022 by Magenaut

I’m trying to convert an integer to binary using the bin() function in Python. However, it always removes the leading zeros, which I actually need, such that the result is always 8-bit:

Categories Python, Q&A Tags binary, bitwise-operators, formatting, python Leave a comment

Reading a binary file with python

August 17, 2022 by Magenaut

I find particularly difficult reading binary file with Python. Can you give me a hand?
I need to read this file, which in Fortran 90 is easily read by

Categories Python, Q&A Tags binary, fortran, python Leave a comment

Python 2.x – Write binary output to stdout?

August 17, 2022 by Magenaut

Is there any way to write binary output to sys.stdout in Python 2.x? In Python 3.x, you can just use sys.stdout.buffer (or detach stdout, etc…), but I haven’t been able to find any solutions for Python 2.5/2.6.

Categories Python, Q&A Tags binary, python, stdout Leave a comment

Convert hex to float

August 16, 2022 by Magenaut

How to convert the following hex string to float (single precision 32-bit) in Python?

Categories Python, Q&A Tags binary, decimal, floating-point, hex, python Leave a comment

Binary numpy array to list of integers?

August 15, 2022 by Magenaut

I have a binary array, and I would like to convert it into a list of integers, where each int is a row of the array.

Categories Python, Q&A Tags binary, numpy, python Leave a comment

How to read bits from a file?

August 14, 2022 by Magenaut

I know how to read bytes — x.read(number_of_bytes), but how can I read bits in Python?

Categories Python, Q&A Tags binary, io, python Leave a comment
Older posts
Newer posts
← Previous Page1 Page2 Page3 Page4 Next →
  1. michealSmith07 on Is there a way to dynamically refresh the less command?August 21, 2022

    That is a very nice post. I like this post.

  2. anonymous on Fix libwacom9 dependency issue when upgrade DebianJune 27, 2022

    saved my day!! Thanks for the help…

  3. sreedhar on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    Thanks its working

  4. saintnick on Fix libwacom9 dependency issue when upgrade DebianMay 10, 2022

    remove libwacom2 worked for me as well

  5. ranafoul on Fix libwacom9 dependency issue when upgrade DebianApril 22, 2022

    apt remove libwacom2 helped on kali 2022.01. gr8

.net ajax asp.net asp.net-core asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 asp.net-web-api bash c# command-line css custom-post-types custom-taxonomy dataframe dictionary django entity-framework functions gridview html iis javascript jquery json linux list matplotlib numpy pandas php plugin-development plugins posts python python-2.7 python-3.x security shell shell-script sql string vb.net webforms wp-query

© 2026 Magenaut • Built with GeneratePress