So, I'm just starting out with Python and am currently working my way through http://diveintopython3.ep.io/ . The code examples are good, but the vast majority of them are small four-line snippets, and I want to see a little more general picture.
As I understand it - and correct me if I am mistaken - every .py file becomes a "module", and a group of modules in a directory becomes a "package" (at least it does if I create a file __init__.pyin this directory). What is it if I do not have a file __init__.py?
So what does each “module” look like? Usually I define only one class in a file? Does anything else in this file do besides the class definition and possibly several commands import?
source
share