Python Forum
Simple text to binary python script
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple text to binary python script
#2
What exactly is your problem? Having difficulties of splitting an array of bits into bytes? Try this:
sub split_bitrange_in_bytes(string_with_bits)
    for bitcounter in range(0, len(string_with_bits), 8):
        print(string_with_bits[bitcounter:bitcounter + 8])
Reply


Messages In This Thread
Simple text to binary python script - by gmills13 - Feb-04-2020, 02:31 PM
RE: Simple text to binary python script - by ibreeden - Feb-04-2020, 07:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Script that alternates between 2 text messages DiscoMatic 1 1,376 Dec-12-2023, 03:02 PM
Last Post: buran
  Python Code for Preorder Traversal of a Binary Tree Bolt 1 2,104 Sep-22-2023, 09:32 AM
Last Post: Gribouillis
  Python script that deletes symbols in plain text nzcan 3 1,834 Sep-05-2023, 04:03 PM
Last Post: deanhystad
  Is there a *.bat DOS batch script to *.py Python Script converter? pstein 3 8,467 Jun-29-2023, 11:57 AM
Last Post: gologica
  How do I read and write a binary file in Python? blackears 6 26,899 Jun-06-2023, 06:37 PM
Last Post: rajeshgk
  Simple Python script, path not defined dubinaone 3 3,987 Nov-06-2021, 07:36 PM
Last Post: snippsat
  How to convert binary data into text? ZYSIA 3 3,732 Jul-16-2021, 04:18 PM
Last Post: deanhystad
  How to assigned value to each different binary in python... ZYSIA 2 3,015 Jul-12-2021, 11:01 AM
Last Post: Gribouillis
  Web Form to Python Script to Text File to zip file to web wfsteadman 1 3,009 Aug-09-2020, 02:12 PM
Last Post: snippsat
  How to convert a python code to binary? rsurathu 0 2,406 Aug-02-2020, 08:09 AM
Last Post: rsurathu

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020