Post Reply 
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:

#PYTHON name
import sys
Export ppl(a)
   PYTHON(name, a);

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.

#PYTHON name
from hpprime import *
line_c(0, -15.9, 0, 15.9, 0, 0x00FF00)
line_c(0, 0, -10, 0, 10, 0xFF0000)
Export zeich(a)
     PYTHON(name, a);
3. I'm using the HOME environment because only there (true?) I can have various independent Python scripts. The <Symb> <Num> combination isn't really handy. But perhaps I haven't seen the obvious.

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.

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

Messages In This Thread
Python oddities - Guenter Schink - 05-05-2021 07:41 PM
RE: Python oddities - toml_12953 - 05-05-2021, 08:56 PM
RE: Python oddities - Guenter Schink - 05-05-2021, 10:24 PM
RE: Python oddities - toml_12953 - 05-06-2021, 12:28 AM

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