المتغيرات العالمية التالية متاحة عالميًا.
واجهة بايثون العالمية.
يمكنك استيراد وحدات 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