The variables defined within a context can be accessed outside of the cotext.
The context is used to apply automatic operations.
// Return a slice copy of the DataFrame based on condition
// indexing operators  and attribute operator .
httpd: Syntax error on line 491 of /home/ubuntu/httpd/conf/httpd.conf: Cannot load /home/ubuntu/httpd/modules/mod_wsgi.so into server: libpython3.6m.so.1.0: cannot open shared object file: No such file or directory
sudo ldconfig /home/ubuntu/miniconda3/lib
Install executable package into a directory (example: /apps/my-app) instead of site-packages
1. Keep all statements, functions, classes in one module (your script !) . No relative imports is allowed.
2. function main() is not needed.
Package Python (package name maintained)
1. Keep the overall package layout flat. The package name is the only entry point of all module imports, use absolute imports only, sub-packages are generally accepted but not encouraged.
from mypackage.mymodule import myfunction
2. Expand sys.path in the module that contains main()
Package Python (package name not maintained)
1. Keep the overall package layout flat. Use relative imports (import from the same folder) only, sub-packages are generally accepted but not encouraged.
from mymodule import xxx
Coding scripts (temporary):
Put all definitions, variables, classes into one script; Or split them into several scripts if really needed (using relative import)
Coding non-trivial packages:
Split definitions, variables, classes into separate scripts; using absolute import, expand sys.path if needed.