Good dev knows: post #262 — TG.ME

🤖 Force ChatGPT to use Python

Did you know that LLMs are often bad at math? When they try to calculate purely based on model weights, they can easily slip. The good thing is that modern models often try to detect when they should use proper tools for math. For ChatGPT, that tool is Python.

And you can do it yourself by simply adding “use python” to your prompt. ChatGPT will then write a script, execute it, and share the result. You can even check the script to verify the logic.

For example:
What shall be my running pace if I run 4 minutes, then walk 1 minute. So that I finish 10k in 55 minutes? use python


Pretty neat, right? But here’s something even cooler. Today I learned that ChatGPT can also use Python to plot simple charts — and that’s super handy.

For example:
Plot this to the chart:

Jan 2025 Running 13
Feb 2025 Running 12
Mar 2025 Running 13
Apr 2025 Running 13
May 2025 Running 13
Jun 2025 Running 13
Jul 2025 Running 12
Aug 2025 Running 11
Sep 2025 Running 9

use python


Works like a charm.

Why is this important? Because when we share information with others, we should think about how to make it easier to consume. And people process charts much better than plain text. So it’s worth spending a minute to quickly wrap your data in a chart 📈.
👍8
September 26, 2025 1.1K 3 3