[Fns] Menus, Modules and Add-On Modules
Topic Links
[Fns…] Menus
[Fns…] shortcut tab displays menus containing frequently used Python functions, keywords, and operators. The menus also provide access to the selected functions and constants from the Modules and Add-On Modules. While you can enter character by character from the keypad, these menus provide a quick way to paste in Editor or Shell. Press [Fns…] when in Editor or Shell. See also Using the Python Catalog and Using the Python Keypad for alternate entry methods.
[Fns...] Built-in, Operators and Keywords
[Fns...] Modules
When using a Python function or constant from a module, always use an import statement to indicate the module location of the function, method or constant.
See What is the Python programming experience?
[Fns…]>Modul: math module
[Fns…]>Modul: random module
[Fns…]>Modul: time module
[Fns…]>Modul: ti_system module
See: Keypad mapping for wait_key()
[Fns…]>Modul: ti_plotlib
Important Plotting Note:
• | The order of program lines for plotting must follow the order as in the Setup menu to ensure expected results. |
• | Plotting displays when plt.show_plot() is executed at the end of the plotting objects in a program. To clear the plotting area in the Shell, press [clear]. To view the Shell history, press [2nd] } and [2nd] †. |
• | Running a second program that assumes the default values are set within the same Shell environment, will generally result in unexpected behavior such as color or other default argument settings. Edit programs with expected argument values or Reinitialize the Shell before running another plotting program. |
[Fns…]>Modul: ti_hub module
ti_hub methods are not listed in Catalog and thus, not listed in the Reference Guide. Please use the screen information in the menus for arguments and argument default or allowed value details. More information on Python programming for
TI-Innovator™ Hub and TI-Innovator™ Rover will be available at education.ti.com.
Note: TI-Innovator™ Hub should be connected when you run your Python programs.
ti_hub module – Add import to Editor and add ti_hub sensor module to the Modul menu
Screen Example: Import sound
To import TI-Innovator™ sensor methods to your Python program, from the Editor,
1. | Select [Fns…] > Modul 6:ti_hub |
2. | Select the ti_hub Import menu. Select a sensor type from Built-in, Input and Output. |
3. | Select a sensor. |
4. | An import statement will paste to the Editor and the sensor module will be available in [Fns...] > Modul when you return to that menu from your program. |
5. | Select [Fns…] > Modul 8:Sound... to paste appropriate methods for this sensor. |
[Fns…]>Modul 6:ti_hub
Note: Brightns is a "built-in" object on TI-Innovator Hub.
When using the 'import brightns' statement, enter 'brightns.range(0,100)' to ensure the correct default range at the start of the program execution.
Example:
import brightns
brightns.range(0,100)
b=brightns.measurement()
print(b)
[Fns…]>Modul ti_rover module
ti_rover methods are not listed in Catalog and thus, not listed in the Reference Guide. Please use the screen information in the menus for arguments and argument default or allowed value details. More information on Python programming for
TI-Innovator™ Hub and TI-Innovator™ Rover will be available at education.ti.com.
Notes:
• | In TI-Python programming, you do not need to include methods to connect and disconnect TI-Innovator™ Rover. The TI-Innovator™ Rover Python methods handle connect and disconnect with no additional methods. This is a bit different than programming TI-Innovator™ Rover in TI-Basic. |
• | rv.stop() executes as a pause and then resume continues with the Rover movements in the queue. If another movement command is executed after rv.stop(), then movement queue is cleared. This again is a bit different than programming TI-Innovator™ Rover in TI-Basic. |
Python Support for TI-Innovator Sketch v1.5