Question 9
Can a module run like regular code?
yes, and it can differentiate its behavior between the regular launch and import
it depends on the Python version
yes, but in cannot differentiate its behavior between the regular launch and import
no, it is not possible; a module can be imported, not run
Correct answer: D
Explanation:
you write a module (a .py file) where it can be executed directly. Alternatively, it can also be imported and used in another module. By doing the main check, you can have that code only execute when you want to run the module as a program and not have it execute when someone just wants to import your module and call your functions themselves. Reference: https://developer.rhino3d.com/guides/rhinopython/python-remote-local-module/
you write a module (a .py file) where it can be executed directly. Alternatively, it can also be imported and used in another module. By doing the main check, you can have that code only execute when you want to run the module as a program and not have it execute when someone just wants to import your module and call your functions themselves.
Reference: https://developer.rhino3d.com/guides/rhinopython/python-remote-local-module/