Giter Site home page Giter Site logo

bin_to_text's Introduction

Text To Binary and Binary To Text Programs

Introduction

This repository contains two Python programs, namely "Text To Binary" and "Binary To Text." These programs allow you to convert text to binary representation and vice versa.

Author

Author: Shreyas Om

Programs

Text To Binary Program

  • Function: texttobin(file_name)

    • This function takes a filename as input, reads the text data from the file, and converts it into a binary representation.
    • It then writes the binary data back to the same file, overwriting the existing content.
  • Usage Example:

    texttobin("input.txt")

Binary To Text Program

  • Function: bintotext(file_name)

    • This function takes a filename as input, reads binary data from the file (assumed to be space-separated), and converts it into text.
    • It then writes the text data back to the same file, overwriting the existing content.
  • Usage Example:

    bintotext("output.txt")

How to Use

  1. Clone or download this repository to your local machine.

  2. Ensure you have Python installed.

  3. Create a text file with the content you want to convert (for Text To Binary) or a binary data file (for Binary To Text).

  4. Modify the file_name parameter in the function calls with the name of your file.

  5. Run the Python script with the desired function to perform the conversion.

  6. Check the output file for the converted data.

Example

Suppose you have a file named "input.txt" with the text "Hello, World!".

You can use the "Text To Binary Program" as follows:

texttobin("input.txt")

This will overwrite "input.txt" with the binary representation of the text.

To convert it back to text, use the "Binary To Text Program":

python

bintotext("input.txt")

This will restore "input.txt" to its original text content.

bin_to_text's People

Contributors

om-shreyas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.