Post Reply 
Passing values from PPL to Python and vice versa - an alternative to AVars
01-30-2024, 08:38 PM
Post: #11
RE: Passing values from PPL to Python and vice versa - an alternative to AVars
FYI if you go from Python to PPL with a complex number, you will have to substitute the Python imaginary indication 'j' with '*i' (CHAR(57347)) prior to passing it on to PPL.
And from PPL to Python you have to convert the string with '*i' to 'j'.
All within the Python script.

#Python to PPL conversion for a complex number
p=17j
p=str(p)
p=p.replace('j','*') #(CHAR(57347)
ppleval('PYPPL.pyresult:=%s' %p)

#PPL to Python string conversion for a complex number
p='17*i' # ie from argv[0]
p=complex(p.replace('*','j')) #(CHAR(57347)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Passing values from PPL to Python and vice versa - an alternative to AVars - gehakte_bits - 01-30-2024 08:38 PM



User(s) browsing this thread: 1 Guest(s)