Post Reply 
Sharing Variables between Python and HPppl
05-18-2022, 01:21 AM (This post was last modified: 05-18-2022 01:44 AM by roadrunner.)
Post: #7
RE: Sharing Variables between Python and HPppl
Sorry, i did not realize ans was a string (even though your first post states it very clearly). That makes it a little more tricky, but:

from hpprime import *
eval("primevar:=\"" + ans + "\"")

should give you a home variable called primevar that contains whatever string is stored in ans.

Then you can run your ppl program with:

eval("pplprogram(primevar)")

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


Messages In This Thread
RE: Sharing Variables between Python and HPppl - roadrunner - 05-18-2022 01:21 AM



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