Description Usage Details Value Warning See Also Examples
Access module metadata.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
When modulr loads a module file, it assigns the module's name to
.__name__
. A module file can discover whether or not it is running
in the main scope by checking if .__name__
has value
"__main__"
. This allows a common idiom for conditionally executing
code in a module file when it is run as a script (see example). It is
mainly useful when one wants to write a module file which can be executed
directly as a script and alternatively declared as a dependency and used by
other modules.
The name of the current module scope.
Do not assign to any metadata in the workspace, because
this will always mask the object of the same name in package:modulr
.
1 2 3 4 5 6 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.