LogicPy V1.0.0
LogicPy
A Python-based interactive logic gate simulator with drag-and-drop components, wiring, saving, loading, and real-time circuit evaluation.
Features
- Drag-and-drop placement of logic gates and components
- Interactive wiring system with bend points
- Switches to toggle signals ON/OFF
- LEDs to display outputs in real-time
- Save and load circuits (JSON format)
- Real-time evaluation of logic gates
- Delete components and wires easily
Note: Your circuit will be saved and loaded using the file namedcircuit.json.
Warning: Be careful! Saving will overwrite the existingcircuit.jsonfile!
Supported Components
- Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR
- Input Components: Switch
- Output Components: LED
- Wires: Connect components with flexible wiring and bend points
Installation
- Make sure Python 3.8+ is installed
- Install pygame and numpy:
pip install pygame, numpy
- Clone this repository:
git clone <(https://github.com/EgeOnderX/LogicPy)>
- Run the simulator:
python main.py
Usage
- Click on a component from the sidebar to select it
- Click on the canvas to place the selected component
- Drag components to reposition them
- Click on slots to start and end wiring
- Right-click on wires or components to delete them
- Press
Sto save the current circuit - Press
Lto load the last saved circuit
Why does this project exist even though there are other logic gate simulators online?
Because unlike the others, this simulator offers:
- Real-time reactions
- The ability to save and reopen circuits
- Wire bending and dynamic interaction
These features make it uniquely responsive and more immersive than standard simulators.
Screenshots
License
MIT License
Copyright (c) 2025 Ege Önder
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.