-
Notifications
You must be signed in to change notification settings - Fork 11
Description
We got a bit of feedback on the execute code lesson from @stefanv that we can integrate into a future version of the execute code lesson! it's below. i just want to document it now that the lesson is merged. ✨
In teaching material, I would try very hard to present One Way of doing something. I know it's tempting to describe all the various ways that code may be executed in Python, but it very quickly becomes overwhelming to a newcomer. When reviewing such material, you have to put on the I-Know-Absolutely-Nothing hat, and then try and read a paragraph like:
Python script.
There are two other ways to execute Python code from the command line, both of which work for code that has been formatted as a package.You can execute modules using their import name
You can execute packages using a main.py file
You can execute functions named commands using project scriptsOverwhelming, because now you really have to have a fine-grained understanding of the difference between modules, packages, and functions.
Whereas learning to run python myfile.py is pretty easy, and covers most use-cases.
Limit the number of distractions. A newcomer doesn't need to know about "side-effects" etc. If you teach them what they need to do, they may run across those things eventually, and may have to figure it out. But, meanwhile, they'll have a very straightforward working example to return to.