a18eaf29fe959284dd4095b367e6cb512a47c6f3
SymPy Math App
Desktop calculator and REPL for SymPy built with PyQt5. Enter expressions and assignments in one window; results render with SymPy’s pretty printer.
Features
- Evaluate SymPy expressions and run assignments in a persistent namespace
- Command history with Up / Down in the input field
- Show Variables — user-defined names only
- Show History — numbered list of prior commands
- Clear — input and results pane
Requirements
- Python 3.8 or newer (recommended; matches SymPy’s supported versions)
- pip
| Package | Version |
|---|---|
| PyQt5 | ≥ 5.15.0 |
| SymPy | ≥ 1.12 |
Quick start
python -m venv venv
Activate the venv (see Installation), then:
pip install -r requirements.txt
python main.py
Installation
1. Create a virtual environment
Windows
python -m venv venv
Linux / macOS
python3 -m venv venv
2. Activate it
Windows (PowerShell)
.\venv\Scripts\Activate.ps1
If execution is blocked:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Windows (Command Prompt)
venv\Scripts\activate.bat
Linux / macOS
source venv/bin/activate
3. Install dependencies
pip install -r requirements.txt
Usage
- Run
python main.py. - Type a SymPy command and press Enter or click Evaluate.
Examples
x = Symbol("x")thenx**2 + 2*x + 1diff(x**2, x)(after definingx)integrate(sin(x), x)
Assignments use =; other lines are evaluated as expressions (via sympify / eval in the SymPy namespace). Clear resets the input and output text only; it does not remove defined variables from the session.
Deactivate the venv when finished:
deactivate
Project layout
math-app/
├── main.py # Application entry point
├── requirements.txt # Locked dependency ranges
├── README.md
└── venv/ # Local virtualenv (create locally; do not commit)
Security note
The app evaluates user input with exec / eval in a restricted builtins context but not in a sandbox. Only run commands you trust.
Description
Languages
Python
100%