Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
calculate_python_expression [2026/08/18 02:26]
hermann
calculate_python_expression [2026/08/18 20:55] (current)
hermann
Line 73: Line 73:
 === Installing packages === === Installing packages ===
  
-Packages can be installed in two ways: calling ''​dinamica.package(...)''​ from within the expression, or listing package names on the //​packages//​ input port, one per line. The two differ in timing: ''​dinamica.package(...)''​ runs **during** the expression, so it can be called conditionally;​ the //​packages//​ port always runs **before** the expression executes. Because ''​dinamica.package(...)''​ runs together with the script, it may fail if a package is already loaded in an incompatible version.+Packages can be installed in two ways: calling ''​dinamica.package(...)''​ from within the expression, or listing package names on the //​packages//​ input port. The two differ in timing: ''​dinamica.package(...)''​ runs **during** the expression, so it can be called conditionally;​ the //​packages//​ port always runs **before** the expression executes.
  
-''​dinamica.package(packageName,​ installPath=None,​ loadPath=None)''​ installs (if needed via pip) and imports the requested module.+**dinamica.package()** 
 + 
 +''​dinamica.package(packageName,​ installPath=None,​ loadPath=None)''​ installs (if needed via pip) and imports the requested module. Because it runs together with the script, it may fail if a package is already loaded in an incompatible version.
  
 ^ Parameter ^ Type ^ Default ^ Description ^ ^ Parameter ^ Type ^ Default ^ Description ^
Line 109: Line 111:
 </​code>​ </​code>​
  
-The //​packages//​ port takes one package identifier per line, in any form accepted by ''​pip''​. ​It only installs — unlike ​''​dinamica.package()'',​ it does not also import the module, and it does not support specifying a separate install name and import name. Every listed package is installed before the expression runs, but the expression must still import each one itself, using its actual importable name (which may differ from the name given to ''​pip''​):+**The packages port** 
 + 
 +The //​packages// ​input port takes one package identifier per line, in any form accepted by ''​pip''​. ​Every listed package is installed before the expression runs. Unlike ​''​dinamica.package()'', ​the port only installs — it does not also import the module, and it does not support specifying a separate install name and import name. The expression must still import each package ​itself, using its actual importable name (which may differ from the name given to ''​pip''​).
  
 The //​packages//​ port: The //​packages//​ port:
Line 275: Line 279:
  
 CalculatePythonExpression CalculatePythonExpression
-