המשתנים הגלובליים הבאים זמינים ברחבי העולם.
ממשק Python העולמי.
אתה יכול לייבא מודולים של Python ולגשת לסוגים ופונקציות מובנות של Python דרך המשתנה הגלובלי
Python
.import Python // Import modules. let os = Python.import("os") let np = Python.import("numpy") // Use builtin types and functions. let list: PythonObject = [1, 2, 3] print(Python.len(list)) // Prints 3. print(Python.type(list) == Python.list) // Prints true.
הַצהָרָה
public let Python: PythonInterface