Quiz
- How do Python modules and shell commands interact? Might be misunderstanding this, but can we use Python modules and functions we write as shell commands? Is that the benefit of writing Python modules like in now_v3.py?
Yes, we can use a file as either a module (importing it into some other program) or as a program in itself. Kinda cool!
- Can we go over modules in Python and the example again?
Glad to! modules
- Can you explain a bit more about when we should use modules/should we always work in modules?
Modules are a way to (1) use code that others have implemented, such as
Flask
and (2) to divide up your own code, as if you were your own client.Modules are a good thing.
- What would be a good example where it would be better to use OOP in our class?
OOP is good when the program builds state and uses it to divide the work among lots of objects. For us, the state mostly lives in the database.
You did some OOP in CS 230: programs that build a representation of a tree or a graph and use it to solve problems.
- How often will we use OOP when it comes to Python in full stack development?
Never in my class. OOP is important, but not for us.
- Could we go over over REPL in class?
For sure!
- I am not sure what p[0] = 7 will do if it is a string.
You'll get an error, because strings are immutable.