A Python script that reads a text file named numbers.txt that contains 20 integers. The program will create two other text file; the first text file will be named even.txt that will contains all even numbers extracted from the numbers.txt. The second text file will be named odd.txt that will contains all odd numbers extracted from the numbers.txt.
To run the program, you'll need to have Python 3 installed on your computer.
Note: This program works only for windows os.
I used VS Code to create and run the program.
The script requires the following Python packages:
- PySimpleGUI
- pyperclip
pip install PySimpleGUI pyperclip
- Clone the repository or download the number_parser.py and number.txt files.
- Open a terminal and navigate to the directory containing the script:
cd /path/to/directory
- Run the script using python:
python number_parser.py
- When prompted, use the "Browse" button to select the file to process.
- To sort the odd and even integers in the file, click the "Process File" button.
- While the script is processing the file, a loading bar will show.
- When the processing is finished, the even and odd numbers will be shown in separate text boxes. By pressing the "Save File" option, you can save them as independent text files. However, if you click "OK" the file
- Click the "Copy Even" or "Copy Odd" buttons to transfer the contents of the even or odd text boxes to the clipboard.
- Click the "Exit" button or close the window to exit the script.