Practical introduction to Python's subprocess module

preview_player
Показать описание
We build a CLI tool utilizing Python's subprocess that, in one command, creates a directory to host our code, initialize git in it, creates the README and gitignore file, write content into the gitignore file, creates a virtual environment, start a task in our todo manager. So much value for personal / developer productivity, eh?

All videos in that playlist use Python's standard library with no / minimal dependencies. We walk through the process of building a CLI productivity tool on top of TaskWarrior. To learn more about TaskWarrior, watch my introduction video:

Timestamps for the impatient:
00:00 Intro: Automating our developer workflow
04:06 Understanding processes (w/ top and htop)
06:24 Python's subprocess module
16:18 Creating our project starter program with subprocess!

Learn how to use webbrowser instead of subprocess for browser-related automation / scripts in Python:
Рекомендации по теме
Комментарии
Автор

Incredible tutorial. Would never think this was such a small channel, until I checked. Great quality!

alexeydmitrievich
Автор

I don’t usually comment often, but I was a bit stunned after accidentally stumbling on your channel and when subscribing realising you don’t have an absolute horde of followers yet. Think something with the YouTube algo still needs to click into place, cause this does not seem right. I like your pace and channel. Good quality and clear. Thanks for this tutorial. Keep them coming.

paulvanjaarsveld
Автор

after lost 60minutes of my finite javascript developer life i found the solution in python :D loved it, thanks

diegognoatto
Автор

One question though… the “project_dir” variable - how did you add the forward slash and projectname variable without putting in quotes. Was expecting it to throw and error cause it’s like you’re dividing the path by projectname

cheybrown
Автор

I have a Python / Operating system question.. In windows, I can plot a file using
type logfile | cantools plot inputfile.dbc

I'd like to do the same using Python. I understand everyone uses Popen, but I have not been able to get it to Pipe the contents of logfile over to cantools (while also passing the Plot and filename arguments).

The following did not work:
args = ["plot inputfile.dbc"]
p = Popen(['cantools'] + args, stdout=PIPE)

Any suggestions?

bennguyen
Автор

By Python how could we earn f as as freelancrer. Please share your experience.

PankajKumar-kwzx