3 ms·
One "non-programmer" perspective here: Python is the new Perl, except it's fast to read AND write. In Python it's fast to do ...everything. I'm an electrical en
by rthomas6 9y ago
One "non-programmer" perspective here: Python is the new Perl, except it's fast to read AND write. In Python it's fast to do ...everything. I'm an electrical engineer by trade, and Python gets used a lot.
* If I have a giant CSV with data in it:
import csv
with open(filename) as csvfile:
csvreader = csv.DictReader(csvfile)
data = list(csvreader)
Bam, an array of dictionaries with the data in them, indexed by column name. With listcomps, whatever I need to do will only take a few more lines. And it's this easy for almost any data format. There will be a widely used library for me to `pip install`.
* I needed to plot some I/Q data and superimpose some other data as a heat map over it. Complex numbers are built in. Matplotlib, and bam, graph created. It looks as nice as the graphs my coworkers make using Matlab, and I coded it up just as fast, if not faster.
* I wanted to play around with ordering a pizza online automatically. Import requests, and off I go.
* The code is so easy to read, I've had coworkers update things I wrote when they have never programmed in Python before.
I don't have to do any compile steps. I don't have to use a special IDE. I don't have to think in objects and state-passing and all that BS (but I can if I want to!). I don't have to search for some arcane library. I don't have to know a magic build sequence. I don't have to edit config files. I just make cool shit really fast. It runs slower, but for most things I use it for, I don't care if it takes 10 us or 10 seconds. I just want to make it work.