
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to prohibit a Python module from calling other modules?
You can use "Sandboxed Python". A "Sandboxed Python" would let you permit or forbid modules, limit execution slices, permit or deny network traffic, constrain filesystem access to a particular directory (floated as "/"), and so on. It is also referred to as RestrictedExecution. There are many ways to implement sandboxing on Python. You could Modify the CPython Runtime, Use Another Runtime, Use Operating System Support, etc to implement such a sandbox. You can read more about sandboxing at: https://wiki.python.org/moin/SandboxedPython
Pypi has a package called RestrictedPython(https://pypi.python.org/pypi/RestrictedPython) that is a defined subset of the Python language which allows to provide a program input into a trusted environment. RestrictedPython is not a sandbox system or a secured environment, but it helps to define a trusted environment and execute untrusted code inside of it.
- Related Articles
- How to make unique objects accessible in other modules of Python?
- How to import a single function from a Python module?
- Calling an ABAP Function Module using Python script to put data in SAP HANA
- How to disable logging from imported modules in Python?
- How to call Python module from command line?
- How to find which Python modules are being imported from a package?
- How to write a python module?
- How to install a Python Module?
- How to develop a Python Module?
- How we can copy Python modules from one system to another?
- Getting Error while calling XBP Function Module via SAP.net connector
- How to use remote python modules?
- Calling a Function in Python
- How to encapsulate Python modules in a single file?
- What is a Python module? How is it different from libraries?
