Prime programming Python vs CAS / xCAS etc - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: HP Prime (/forum-5.html) +--- Thread: Prime programming Python vs CAS / xCAS etc (/thread-17712.html) |
Prime programming Python vs CAS / xCAS etc - dougie - 11-16-2021 11:51 AM Hi all, I'm using my Prime now quite a while, even when only at 5% of its capabilities. I just installed the 20210505 Software and was happy about the Python support, which immediately triggered the interest of using it. However: I'm new to programming the Prime and in principle it doesn't matter which language I'm going to use, as long it is able to solve my tasks. Only as an example: I would like CAS to perform a polynominal division using quot and rem. I would like to enter the polynomic and the quotient using the INPUT function and store them in User Variables like e.g. P and Q for later use. The results from 'quot' and 'rem' should also be stored in User Variables for later use. I tried to do that in Python by studying a number of Examples, but the existing documentation is sparse. Therefore it might be easier using any other possible language, which is better documented? Here's my work so far... I've no Idea now how to store and read User Variables from within a program and to call CAS functions. In case there's a good documentation I could use, that would be also great. (then I don't have to bother you :-) ) Code:
RE: Prime programming Python vs CAS / xCAS etc - toml_12953 - 11-16-2021 06:56 PM (11-16-2021 11:51 AM)dougie Wrote: Hi all, For the most part, Python is totally separate from Home and CAS. You can execute their functions by using exec("command") where command is the command you want to execute. This must be used sparingly if you don't want to bog down your program, however. exec is very wasteful of time. I hope that a future revision will include the time module which includes monotonic() rather than have to use exec("time") to time programs. |