Python
ImportModule
import a module in the Python environment
Calling Sequence
Parameters
Description
Examples
Compatibility
ImportModule(package)
package
-
string or sequence of strings
The ImportModule command is used to import modules in the Python environment.
When package is a simple name, ImportModule(package) is equivalent to EvalString("import package",'output'='none').
When package already contains the string "import", usually as part of a more complicated import directive, then ImportModule(cmd) is the same as EvalString(cmd,output=none).
This function is part of the Python package, so it can be used in the short form ImportModule(..) only after executing the command with(Python). However, it can always be accessed through the long form of the command by using Python[ImportModule](..).
with⁡Python:
ImportModule⁡statistics
EvalString⁡statistics.mean([1,2,3])
2
ImportModule⁡math as M
EvalString⁡M.sin(0)
0.
ImportModule⁡from bs4 import BeautifulSoup
The Python[ImportModule] command was introduced in Maple 2018.
For more information on Maple 2018 changes, see Updates in Maple 2018.
See Also
Python:-EvalString
Download Help Document