How do I use $znspace and Other $Functions and $Variables in Embedded Python?
Hi folks!
Just curious, how can I use $znspace in embedded python code?
How does other $functions work, e.g. $zv, $job, etc
Product version: IRIS 2023.1
Hi folks!
Just curious, how can I use $znspace in embedded python code?
How does other $functions work, e.g. $zv, $job, etc
What’s the point of using Python and attempting to keep using ObjectScript functions, find python alternatives
Python can do multithreading, do you can process in background
This was related to OwnObjectScriptExtension. It has a nice feature of converting ObjectScript to Python. It converts quite nice but gets stuck with such special variables.
If I find no acceptable equivalent in PY
I wrap such functions, methods, variables, ... in 1 line COS (class)methods.
kind or embedded COS 😏
After a bit of digging I came up with the following equivalents.
$Horolog
Equivalent access:
$NAMESPACE ($ZNSPACE)
ZN [Namespace] - aka change namespace
Keep your object fingers in the car at all times!!
Any created object script references need to be cleared BEFORE changing back. Is it necessary.
$JOB
$SYSTEM - Instance name
But you might have same name on different operating system / container so:
$ZTIMESTAMP
$ZTIMEZONE – Contains the time zone offset from the Greenwich meridian
$ZVERSION – Contains a string describing the current version of InterSystems IRIS
Thanks a lot, @Alex Woodhead !
@Philipp Bonin , maybe you could consider that in your wonderful ObjectScript to Embedded Python translator?
Thanks, @Alex Woodhead !
What about $objproperty and $objmethod?
The first one could be really helpful
Hi Evgeny,
Not saying this is best way but this indirection can be achieved with python eval. For example:
$Classmethod equivalent
$Property equivalent
Instantiating a Python exception and then iterate over properties printing out:
output was: