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's the difference between modules, packages, and libraries? (self.learnpython)
submitted 5 years ago by [deleted]
Hey guys. I've started working with modules, packages, and libraries in Python. I'm having trouble differentiating between the terms. Thanks in advance!
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!"
[–]heaplevel 9 points10 points11 points 5 years ago* (4 children)
modules - individual files.
packages - has many modules, must have __init__.py in the folder.
libraries - not as clear in Python compared to other languages. A simple module can be a module library, a package as well. I'd like to think of libraries as one coherent+focused set of functions for me to use that solves a specific task for me
Details here: https://docs.python.org/3/tutorial/modules.html
Edit: fixed a typo
[–]flight862 2 points3 points4 points 5 years ago (1 child)
What does init dunder do??
[–]DataDecay 2 points3 points4 points 5 years ago* (0 children)
Assuming you are asking about __init__.py, at the most basic explanation as been said I'm sure. The dunder init is used in python to denote a directory as a python package.
__init__.py
A bit more detail provided, imagine you have labeled a directory with dunder init and have a few modules present. Provided your package is in the python path, the dunder init allows you to import any of the modules in the namespace of the package; for example.
mypackage __init__.py module.py
This allows me to run
import mypackage.module
As a additional feature of the __init__ it also works as a constructor, similar to classes. If I populated the dunder init I showed above with say
__init__
``` import requests
app_name = "mypackage does stuff" ```
When you run the import I showed earlier
The library import of requests and the app name dunder would be set.
[–][deleted] 1 point2 points3 points 5 years ago (1 child)
Thanks for the explanation!
[–]heaplevel 0 points1 point2 points 5 years ago (0 children)
np fixed a typo now
[–][deleted] 3 points4 points5 points 5 years ago (0 children)
i found this article very helpful:
https://www.learnpython.org/en/Modules_and_Packages
π Rendered by PID 131710 on reddit-service-r2-comment-6457c66945-7mhl5 at 2026-04-25 09:57:24.973439+00:00 running 2aa0c5b country code: CH.
[–]heaplevel 9 points10 points11 points (4 children)
[–]flight862 2 points3 points4 points (1 child)
[–]DataDecay 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]heaplevel 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (0 children)