HP Forums

Full Version: Python: Is it possible to create/import/export .py files into the calculator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
title.
(10-26-2021 11:49 PM)marethyu Wrote: [ -> ]title.

Yes. What I do is to connect the calculator via USB, open the Connectivity Kit (CK), Start a new program in the kit (right click on the word program on the left side and click new) An entry box will appear on the right with a Main tab. Copy and paste the Python code from your text editor into the Main box on the right.. Insert the following line before the first line of your program:
Code:
#PYTHON name

Now, after the last line of your code add this:

Code:
#end
EXPORT pyhat()
BEGIN
  PYTHON(name);
END;
but change "pyhat" to the name of your program.

Click the double floppy icon at the top of the CK to save the program to the physical calculator.
Now you can run the Python program the same way as you run any other Prime program.
I see. Thanks for the reply!

By the way, where can I find extensive documentation for HP Prime Python? I want to know more about some built-in modules like `graphics` `hpprime`, and `cas`.
(10-27-2021 03:34 AM)marethyu Wrote: [ -> ]I see. Thanks for the reply!

By the way, where can I find extensive documentation for HP Prime Python? I want to know more about some built-in modules like `graphics` `hpprime`, and `cas`.

Actually, I think it has the same stuff as standard MicroPython so whatever you learn with that should carry over, or at least mostly carry over if I'm not much mistaken.
Matplolib and other libraries are supported?
That would be very interesting (I have no prime)
(10-30-2021 11:35 AM)floppy Wrote: [ -> ]Matplolib and other libraries are supported?
That would be very interesting (I have no prime)

It sure would be interesting but I haven't seen a way to add pre-compiled libraries. If there is a way, I wish someone would let us know. That would make it so much more useful!
Reference URL's