Post Reply 
new user python on hp prime g2, casio cg50
05-26-2021, 06:28 AM
Post: #11
RE: new user python on hp prime g2, casio cg50
Following on this, is there a way to return the output from a Python script embedded in a PPL program to the stack?

For example, this program will print the output to the Terminal:
Code:

#PYTHON test
#test.py
import sys
 
def sqrx(x):
  return int(x)**2
   
y = sqrx(sys.argv[0])
print(y)

# Return the value of y to the stack? 

#end 
 
EXPORT PYTEST(a)
BEGIN
  PYTHON(test,a);
END;

Is there a way of returning 4 instead of 0 as shown in the screenshot?

[Image: AQgBXog.png]

-DrBarnack
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: new user python on hp prime g2, casio cg50 - drbarnack - 05-26-2021 06:28 AM



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