How to Measure a Python Script’s Energy Use
Measure a Python script’s energy use with a clear boundary, a CodeCarbon tracking template, repeated comparisons and a worked reporting example.
PhD • Study • Tech • Sustainability
Browse every article in the Sustainable Tech collection below, including practical guides to digital habits, devices, software, AI, infrastructure, repair and technology careers.
For a guided route through the subject, begin with the Sustainable Tech hub. It organises the collection by what you want to understand or change, with suggested starting points for beginners, students and people learning to code.
Measure a Python script’s energy use with a clear boundary, a CodeCarbon tracking template, repeated comparisons and a worked reporting example.
Understand carbon-aware computing with a worked scheduling example, deadline checks, data requirements and a practical plan for a small pilot.
Build a green tech portfolio with focused project ideas, a reusable case study template and practical ways to show evidence without overstating your impact.
Create a sustainable design portfolio with a practical case study template, project ideas and a worked example showing research, testing and honest impact claims.
A short AI text prompt often uses roughly 0.2–0.4 Wh, but reasoning, images and model choice can raise energy use substantially.
Try ten green coding experiments with fair comparisons, corrected Python examples and clear limits on what runtime and memory can tell you.
You don’t need a robotics lab or a newly built house to enjoy a sustainable, intelligent residence. With a few connected devices and a clear plan, you can start automating everyday tasks, save energy and create a calmer, more efficient living space.
The Sustainable Tech section is here to help you use technology in ways that support both your wellbeing and the planet. Let’s explore this hopeful world.
Learn what green software is, how it reduces energy, hardware and carbon impacts, and the practical principles developers can apply.
Learn what makes code energy efficient, what to measure and which practical changes can reduce compute, data transfer and wasted work.