Python oddities
|
05-05-2021, 07:41 PM
Post: #1
|
|||
|
|||
Python oddities
reported to calcbeta
Beta 04/28 and earlier recent Betas G2 and Virtual, not tested on G1 1. Reboot 2. Drawing not correct 1. Run a Python script from Home, change to any APP, and the G2 reboots. From Tim's document "PPL-Changes + python.odt" I copied this snipped: Code: #PYTHON name The Python program runs o.k. from Home screen by entering ppl(5), but when I later push <APP> <Python> or any other App, the Prime kindly reports "Your HP Prime had a problem and will reboot in 3 seconds." Which it does. Short interrupt only, yet annoying. Every time I make some edits to a script I switch the Prime off and on again in order not to loose anything. ___________________________________________________________________________ 2. Drawing functions in Python. Preface: I'm working my way to Python and your implementation of it as a newcomer. Maybe I overlook the obvious. I've set up this short program to test some drawing functions. As you can see, I have used two options for setting the cartesian parameters. Either with "eval" of "hpprime" or with Python's "set_cartesian" (which is now deactivated) both work fine with "line_c" and "textout_c" but not with "fillrect_c" or "rect_c" that is the latter two don't do anything. The non-cartesian commands are there for comparison. These are the commands I have tested, can't say anything of the other ones. Code: #PYTHON name I ran all these tests again after I rest the Prime including formatting the "disk", no change. Yet I think it's a great improvement and keeps me busy to explore new things, thank you very much for these achievements. Günter |
|||
05-05-2021, 08:56 PM
Post: #2
|
|||
|
|||
RE: Python oddities
(05-05-2021 07:41 PM)Guenter Schink Wrote: reported to calcbeta Where is PPL-Changes + python.odt? When I try to export the program name (hat), I get an error at Export hat() Tom L Cui bono? |
|||
05-05-2021, 10:24 PM
Post: #3
|
|||
|
|||
RE: Python oddities
(05-05-2021 08:56 PM)toml_12953 Wrote: Where is PPL-Changes + python.odt? It was in Tim's announcement https://www.hpcalc.org/prime/beta/betanotes.zip I think the syntax is not really obvious, could you post your code? Perhaps I can help. There are two distinct structures in the mentioned document, either one works, but don't mix them. BTW, I took the freedom to tailor your Pyhat a bit. There is no improvement, I just played a little bit with Python things. Code: #PYTHON EXPORT name(c) This has to be copied into an PPL program to work. Then it can be called by "pyhat(0)", any number instead of "0" will do. Günter |
|||
05-06-2021, 12:28 AM
(This post was last modified: 05-06-2021 12:53 AM by toml_12953.)
Post: #4
|
|||
|
|||
RE: Python oddities
(05-05-2021 10:24 PM)Guenter Schink Wrote:(05-05-2021 08:56 PM)toml_12953 Wrote: Where is PPL-Changes + python.odt? OK, I got it to work now. Thanks! I did change the line to fg=exec("rgb(0,255,0)") since that keeps the figure green and doesn't exact a time penalty by being enclosed in the loop. What's the purpose of "mache"? Tom L Cui bono? |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 3 Guest(s)