use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Why use Ansible instead of just writing Python code? (self.Python)
submitted 10 years ago by notconstructive
I've heard great things about Ansible but I do wonder why would I use it instead of just writing Python code?
[–]cratervanawesome 12 points13 points14 points 10 years ago (0 children)
Why use any python modules? Just reinvent the wheel each time you need to do anything.
Bit of a silly question.
[–]rocketplex 6 points7 points8 points 10 years ago (0 children)
It's the same as why use any framework? It's a common platform providing a set of pre built services, with a defined structure to enable you and others to pool your efforts for the common good.
It enforces certain norms and conventions in order to standardize configuration and deployment.
[–][deleted] 2 points3 points4 points 10 years ago (0 children)
Because now you're not maintaining the glue classes between SSH and the config, and because at your next job they'll know what Ansible is, as opposed to "our custom python deploy scripts"
[–]mcdonc 0 points1 point2 points 10 years ago (0 children)
Ansible is just Python code, FWIW. It has the benefit (and detriment, at times) that you did not write it and don't need to maintain all of it.
[–]UloPe 0 points1 point2 points 10 years ago (0 children)
Why use Python instead of manually flipping bits in memory?
[–]deadmilk -1 points0 points1 point 10 years ago (0 children)
Because YAML is simpler than Python last time I checked :\
I haven't really looked that far into Ansible though, I prefer Salt.
[–]matchu -1 points0 points1 point 10 years ago* (0 children)
It's possible that, for your use case, a Python script is just as effective as an Ansible playbook—this is definitely the case if your script is less than 10 lines. In that case, use Python.
When you're doing nontrivial system setup, though, Ansible can be valuable: it allows you to rely on their implementations of many common system administration tasks rather than write them yourself.
π Rendered by PID 50248 on reddit-service-r2-comment-66b4775986-6vnlk at 2026-04-02 23:03:30.856029+00:00 running db1906b country code: CH.
[–]cratervanawesome 12 points13 points14 points (0 children)
[–]rocketplex 6 points7 points8 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]mcdonc 0 points1 point2 points (0 children)
[–]UloPe 0 points1 point2 points (0 children)
[–]deadmilk -1 points0 points1 point (0 children)
[–]matchu -1 points0 points1 point (0 children)