Python Baseball Sim Update: Adding Pitcher Logic and JSON Data Support

Published: (March 13, 2026 at 05:02 PM EDT)
1 min read
Source: Dev.to

Source: Dev.to

Update Overview

Hi everyone, I’m back with another update! Today I added Pitcher Logic to my baseball simulation, making the game much more realistic.

Pitcher’s Out Probability

The biggest change is the addition of a Pitcher’s Out Probability. When the pitcher is in top form and hits that probability, all potential hits—singles, doubles, triples, and even walks—are converted into outs, except for home runs. This captures the feeling of a pitcher dominating an inning.

How to Use

You can create your own team profiles and save them as .json files. Just make sure to adjust the file paths in the code to match where you saved them on your computer.

Feedback

What do you think about this “Out Probability” logic? I’d love to hear your feedback!

Thanks for checking it out.

0 views
Back to Blog

Related posts

Read more »

I made my first Python toolkit

I made my first Toolkit in Python called Cartons. It generates routes on maps using Folium and Routingpy OSRM. I’d love to hear your opinions on the project. I’...