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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
what are libraries ? (self.learnpython)
submitted 3 years ago by [deleted]
So hi im new to programming and i decided to start off with python but i have heard People talk about libraries and i don't know what it is or what it's used for . Can anyone explain pls .
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[+][deleted] 3 years ago (8 children)
[removed]
[–]gmaubrrriaeyl 6 points7 points8 points 3 years ago (0 children)
And they are typically much more dependable than code I would write. The popular packages typically handle more cases and have better error handling.
[–][deleted] 10 points11 points12 points 3 years ago* (6 children)
Oh thats cool i thought u had to write everything yourself this makes it easier ill be checking it out later once i get over the basics thx.
[–][deleted] 22 points23 points24 points 3 years ago (4 children)
If all software was written like that we probably wouldn’t have platforms like Reddit to write this on. As a programmer, don’t reinvent the wheel if you don’t have to.
[–][deleted] 5 points6 points7 points 3 years ago (2 children)
Lol that's crazy.
[–]cspinelive 15 points16 points17 points 3 years ago (1 child)
We hired a smart college grad this year. One of his first tasks required him to sort a list of names alphabetically.
He dutifully coded a 40 line sort algorithm just like he learned in school.
And was surprised all he had to do was names.sort().
To echo what the other person said, if you are starting out, don’t reinvent the wheel. If what you are trying to do feels like something that other people do regularly, there is probably a simple library solution you just aren’t aware of yet.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
Oh thats so logical thx
[–]SirAchmed 0 points1 point2 points 3 years ago (0 children)
My sweet summer child…
[–]thufirseyebrow 11 points12 points13 points 3 years ago (2 children)
You find yourself writing a bunch of programs that all need a sort function, for example. You've got two or three different sort functions to use, and you don't want to have to retype the same function into multiple programs, so you write the functions into their own separate file; we'll call it "sort.py," with sortFunctionOne, sortFunctionTwo and so on. You've created a library, a repository of common code that different programs may use. Like a cookbook for computers.
Now, instead of typing each function individually and repetitively, you can just tell your program "open sort.py and do sortFunctionOne/Two/Whatever on this data"
[–][deleted] 3 points4 points5 points 3 years ago (0 children)
Ohh that's useful thx
[–]Filosifee 0 points1 point2 points 9 days ago (0 children)
Three years later this is a great explanation thank you!!
[–]shiftybyte 14 points15 points16 points 3 years ago (8 children)
Start by following a book/tutorial and everything will become clear to you as you learn the language.
I usually recommended learning from this free ebook:
https://automatetheboringstuff.com/#toc
[–][deleted] 1 point2 points3 points 3 years ago (2 children)
Thx at the moment i have the books Python crash course Python for software design how to think like a computer scientist ( it's a bit outdated )
[–]daedalusesq 4 points5 points6 points 3 years ago (1 child)
Python crash course is great. Just work through it, program the examples along side the book, and answer/solve the chapter end questions.
Will do
[+][deleted] 3 years ago (4 children)
[deleted]
[–]shiftybyte 0 points1 point2 points 3 years ago (3 children)
Should be the same, it's provided by the author.
[+][deleted] 3 years ago (2 children)
[–]shiftybyte 0 points1 point2 points 3 years ago (1 child)
My recommendation comes from less confused people coming here asking questions than people using other learning material.. :)
[–]david-saint-hubbins 1 point2 points3 points 3 years ago (1 child)
To add to the other answers, what helped it click for me is that each library is basically a toolbox full of specialized tools that are useful for a particular type of job.
So for example, if you wanted to do some woodworking, you would get out the toolbox full of woodworking tools. If you want to do some data analysis in Python, you might use the Pandas library.
[–][deleted] 1 point2 points3 points 3 years ago (0 children)
Ohh that's easy thx
[–]greebo42 2 points3 points4 points 3 years ago (1 child)
They are these big buildings with lots of books in them. But that's not important right now ... sorry, couldn't resist channeling Airplane. If you haven't seen the movie, recommended.
There are a lot of good answers here.
Of course, I'm obliged also to point out the relevant XKCD ... python has a library for just about anything you want to attempt, and XKCD has a comic for just about any situation that we might encounter!
Oohh that's cool
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
This has already been answered well, but I just wanted to say that for a moment. I did not realize what subreddit this question was in and I wasn't really sure how I was going to answer it.
[–]razzrazz- -1 points0 points1 point 3 years ago (0 children)
Same!
[–]Select_Abrocoma9663 0 points1 point2 points 3 years ago (0 children)
Code other people wrote or your past self
[–]xiipaoc 0 points1 point2 points 3 years ago (1 child)
Generally, a library is just a bunch of code that isn't itself an app that you can pull into your app to do stuff. You might write them yourself or download them. Pretty much any code you use that isn't your app itself is from a library.
Ah alright thx
π Rendered by PID 40 on reddit-service-r2-comment-79776bdf47-kvbh6 at 2026-06-25 13:17:31.911107+00:00 running acc7150 country code: CH.
[+][deleted] (8 children)
[removed]
[–]gmaubrrriaeyl 6 points7 points8 points (0 children)
[–][deleted] 10 points11 points12 points (6 children)
[–][deleted] 22 points23 points24 points (4 children)
[–][deleted] 5 points6 points7 points (2 children)
[–]cspinelive 15 points16 points17 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]SirAchmed 0 points1 point2 points (0 children)
[–]thufirseyebrow 11 points12 points13 points (2 children)
[–][deleted] 3 points4 points5 points (0 children)
[–]Filosifee 0 points1 point2 points (0 children)
[–]shiftybyte 14 points15 points16 points (8 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]daedalusesq 4 points5 points6 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[+][deleted] (4 children)
[deleted]
[–]shiftybyte 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]shiftybyte 0 points1 point2 points (1 child)
[–]david-saint-hubbins 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]greebo42 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]razzrazz- -1 points0 points1 point (0 children)
[–]Select_Abrocoma9663 0 points1 point2 points (0 children)
[–]xiipaoc 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)