How can I discover which version of Python I am running? - 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: How can I discover which version of Python I am running? (/thread-19962.html) |
How can I discover which version of Python I am running? - StephenG1CMZ - 05-16-2023 10:30 AM So far I have this (tested only on Numworks): Code:
With the news that Python may be coming to the HP Android, I wonder how it might best be recognised? RE: How can I discover which version of Python I am running? - drbarnack - 05-16-2023 12:09 PM You could try something that uses sys.platform like Code:
RE: How can I discover which version of Python I am running? - Guenter Schink - 05-16-2023 07:19 PM You could also use, similar to Casio and Ti: Code: try: Günter RE: How can I discover which version of Python I am running? - StephenG1CMZ - 05-17-2023 07:04 AM Ah, so there are two alternatives. The try import hpprime matches how the other calculators are detected. But the prime version also has sys.platform. That has the advantage that sys.platform will also show if the code is running on non-calculator hosts. RE: How can I discover which version of Python I am running? - StephenG1CMZ - 05-21-2023 08:48 PM I have placed a version here, using the built-in sys where it is available: https://www.hpmuseum.org/forum/thread-19989.html Tested only on Numworks as Python has yet to reach HP Prime Android. |