A Python-based interactive logic gate simulator with drag-and-drop components, wiring, saving, loading, and real-time circuit evaluation.
- 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 named
circuit.json
. Warning: Be careful! Saving will overwrite the existingcircuit.json
file!
- Logic Gates: AND, OR, NOT, NAND, NOR, XOR, XNOR
- Input Components: Switch
- Output Components: LED
- Wires: Connect components with flexible wiring and bend points
- 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
- 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
S
to save the current circuit - Press
L
to load the last saved circuit
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.

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.