What is the Python programming experience?

TI-Python is based on CircuitPython, a variant of Python designed to fit in small microcontrollers. The original CircuitPython implementation has been adapted for use by TI.

The internal storage of numbers for computation in this variant of Circuit Python is in limited-precision binary floats and thus cannot exactly represent all possible decimal values. The differences from actual decimal representations that arise when storing these values can lead to unexpected results in subsequent calculations.

For Floats - Displays up to 16 significant digits of precision. Internally, values are stored using 53 bits of precision, which is roughly equivalent to 15-16 decimal digits.
For Integers - The size of integers is limited only by the memory available at the time calculations are performed.

Modules Included in the TI-84 Plus CE Python

Built-ins
math module
random module
time
ti_system
ti_plotlib
ti_hub
ti_rover

Note: If you have existing Python programs created in other Python development environments, please edit your program(s) to the TI-Python solution. Modules may use different methods, arguments, and ordering of methods in a program as compared to the ti_system, ti_plotlib, ti_hub, and ti_rover modules. In general, be aware of compatibility when using any version of Python and Python modules.

When transferring Python programs from a non-TI platform to a TI platform OR from one TI product to another:

- Python programs that use core language features and standard libs (math, random etc.) can be ported without changes

Note: List length limit is 100 elements.

- Programs that use platform-specific libraries - matplotlib (for PC), ti_plotlib,
ti_system, ti_hub, etc. for TI platforms, will require edits before they will run on a different platform.
- This may be true even between TI platforms.

As with any version of Python, you will need to include imports such as, from math import *, to use any functions, methods, or constants contained in the math module. For an example, to execute the cos() function, use import to import the math module for use.

See CATALOG Listing.

Example:

>>>from math import *

>>>cos(0)

1.0

Alternate Example:

>>>import math

>>>math.cos(0)

1.0

Modules available can be displayed in the Shell using the following command

>>> help("modules")

__main__ sys gc

random time array

math builtins collections

Content of modules can be viewed in the Shell as shown using “import module” and “dir(module).”

Not all module contents appear in the quick paste menus such as [Fns…] or y N.

Contents of selected modules and keywords

For list of the modules included in this release, please see:

Appendix: Selected TI-Python Built-in, Keywords, and Module Content

Reminder: For any computer/TI-Python experience: After creating a Python program on the computer, please validate your program runs on the calculator in the TI-Python experience. Modify the program as needed.


These screens display the module contents for math and random.

math module

random module



These screens display the module contents for time and ti_system.

time

ti_system



These screens display the module contents for ti_plotlib.

 

ti_plotlib

 



This screen displays the module contents for ti_hub.

 

ti_hub

 



These screens display the module contents for ti_rover.

 

ti_rover