Minor changes
This commit is contained in:
@@ -9,26 +9,28 @@ This Python script generates a brain jogging PDF with math problems. The PDF con
|
|||||||
- argparse
|
- argparse
|
||||||
|
|
||||||
You can prepare the environment and install the reportlab library using pip:
|
You can prepare the environment and install the reportlab library using pip:
|
||||||
|
```
|
||||||
python -m venv env
|
python -m venv env
|
||||||
source env/bin/activate
|
source env/bin/activate
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install reportlab
|
pip install reportlab
|
||||||
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
You can run the script from the command line:
|
You can run the script from the command line:
|
||||||
|
```
|
||||||
|
|
||||||
python brain-jogging.py [filename]
|
python brain-jogging.py [filename]
|
||||||
|
```
|
||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
The script contains the following functions:
|
The script contains the following functions:
|
||||||
|
|
||||||
- format_and_return(a, b, operation, result): Formats and returns a math problem string along with its result.
|
- `format_and_return(a, b, operation, result)`: Formats and returns a math problem string along with its result.
|
||||||
- generate_math_problem(): Generates a random math problem with an operation chosen from addition, subtraction, multiplication, or division.
|
- `generate_math_problem()`: Generates a random math problem with an operation chosen from addition, subtraction, multiplication, or division.
|
||||||
- create_brain_jogging_pdf(filename): Creates a brain jogging PDF with math problems and saves it to the specified filename.
|
- `create_brain_jogging_pdf(filename)`: Creates a brain jogging PDF with math problems and saves it to the specified filename.
|
||||||
- main(): The main function that parses command-line arguments and calls the create_brain_jogging_pdf() function with the provided arguments.
|
- `main()`: The main function that parses command-line arguments and calls the `create_brain_jogging_pdf()` function with the provided arguments.
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|||||||
Reference in New Issue
Block a user