top of page

🐍 A Python Trick to Quietly Impress Your Colleagues

  • mark
  • Mar 17
  • 1 min read

As more and more geologists in mining companies turn to Python scripting for handling drillhole data, block models, QAQC, and reporting, the little things start to matter.


You might not notice this one at first.


It won’t revolutionize your workflow.


But it will save you a few seconds — and make your debug output look slick 😏.


If you’re working with assay tables, tonnage estimates, or anything buried in CSVs and models, Python 3.12 just added a neat trick: f-string debugging.


Enhanced f-string Debugging


Instead of typing this:


Print tonnage grade, the old way
Print tonnage grade, the old way

Now you can write:

Print tonnage grade, the new way
Print tonnage grade, the new way



The output
The output

No fuss, no formatting, no need to remember what variable is what. Just clean, readable output — especially handy when your script is spitting out facies proportions or block estimates.


⛏️ Why It’s a Handy Win for Mining Geos


  • 🧪 Ideal for quick checks while cleaning or merging drillhole datasets

  • 📊 Makes QAQC outputs clearer when checking grade distributions

  • 🤓 A subtle way to show off next time you're pair-programming with another geo


So the next time you’re looping through intervals or compositing grades in Python, toss in an f"{mean_grade=}" and let the console look smart for you 😄

Already using Python 3.12?Let us know your favorite new feature.

Comments


bottom of page