- How to Adjust X and Y Axis Scale in Arduino Serial Plotter (No Extra Software Needed)Posted 2 months ago
- Elettronici Entusiasti: Inspiring Makers at Maker Faire Rome 2024Posted 2 months ago
- makeITcircular 2024 content launched – Part of Maker Faire Rome 2024Posted 5 months ago
- Application For Maker Faire Rome 2024: Deadline June 20thPosted 6 months ago
- Building a 3D Digital Clock with ArduinoPosted 11 months ago
- Creating a controller for Minecraft with realistic body movements using ArduinoPosted 12 months ago
- Snowflake with ArduinoPosted 12 months ago
- Holographic Christmas TreePosted 12 months ago
- Segstick: Build Your Own Self-Balancing Vehicle in Just 2 Days with ArduinoPosted 1 year ago
- ZSWatch: An Open-Source Smartwatch Project Based on the Zephyr Operating SystemPosted 1 year ago
Python for not engineers: How to automate boring stuff in a heartbeat!
“Learn to code” is the new mantra for the 21st century. What’s often lost in that statement is exactly what makes programming so useful if you’re not planning to switch careers and become a software engineer.
That was the beginning of a post dealing with Python programming for not experts. Why should you learn a programming language if you’re not interested in software dev?
Simple: because it is faster than doing a bunch of boring things, that you must do manually if you don’t know how to computerize that.
An example? A simple code to sort file in chronological order:
import os, shutil monthMapping = {'Jan': '1', 'Feb': '2', 'Mar': '3', 'Apr': '4', 'May': '5', 'Jun': '6', 'Jul': '7', 'Aug': '8', 'Sep': '9', 'Oct': '10', 'Nov': '11', 'Dec': '12'} for filename in os.listdir(): monthPart = filename[:3] yearPart = filename[3:7] newFilename = yearPart + '_' + monthMapping[monthPart] + '.csv' print('Renaming ' + filename + ' to ' + newFilename) #shutil.move(filename, newFilename)
full detail and sintax here: Automate the boring stuff with Python