TI NSpire CX II python 可以调用内置函数吗?
Can TI NSpire CX II python call built-in functions?
Texas Instruments 最近在其 TI Nspire CX II 模型中添加了直接 python 编程。
计算器的内置函数已经包含一系列非常强大的数学 API。例如,您可以在 python 中调用 isPrime()
内置函数吗?
我知道,这个函数可以很容易地重新创建为 NSpire 中的 python 模块。但是除此之外还有更多的内置函数。 Nspire 的 python 有没有办法调用这些内置函数?
使用eval
:
Module: Built-in
Syntax: eval(x)
Description: Returns the evaluation of the expression x.
Example:
>>>a=7
>>>eval(“a+9”)
16
>>>eval(‘a+10’)
17
https://education.ti.com/html/webhelp/EG_TI84PlusCE-T/ES/content/eg_pythonappprog/m_pyref/m_e.HTML
不行:这行不通。查看评论。
安装后 Ndless and khicas
into my two calculators TI Nspire CX CAS II
and TI Nspire CX CAS
, in the khicas documentation 描述如下:
Unlike adaptations of Micro-Python by calculator manufacturers (including Casio), the Python syntax in Xcas is fully integrated. You can therefore use all Xcas commands and data types in your programs. This corresponds approximatively to importing Python modules math, cmath, random, scipy, numpy, turtle, giacpy. There is also a small pixelised graphic commands set (set_pixel(x,y,c), set_pixel() to synchronize display, clearscreen(), draw_line(x1,y1,x2,y2,c), draw_polygon([[x1,y1],[x2,y2],...],c), draw_rectangle(x,y,w,h,c), draw_circle(x,y,r,c), the color+width+filled c parameter is optional, draw_arc(x,y,rx,ry,t1,t2,c) draws an ellipsis arc). And you can somewhat replace matplotlib with graphic commands of
χ
CAS (point, line, segment, circle, barplot, histogram and all ...plot... commands). Plus you have natural access to data types like rationnals or expressions, and you can run CAS commands on them. The complete list of commands available on the calculator is given in appendix. For documentation on commands not listed in the catalog categories, please refer to Xcas documentation.
目前TI Nspire CX CAS II
,其python环境无法调用nspire内置的数学函数。
Texas Instruments 最近在其 TI Nspire CX II 模型中添加了直接 python 编程。
计算器的内置函数已经包含一系列非常强大的数学 API。例如,您可以在 python 中调用 isPrime()
内置函数吗?
我知道,这个函数可以很容易地重新创建为 NSpire 中的 python 模块。但是除此之外还有更多的内置函数。 Nspire 的 python 有没有办法调用这些内置函数?
使用eval
:
Module: Built-in
Syntax: eval(x)
Description: Returns the evaluation of the expression x.
Example:
>>>a=7
>>>eval(“a+9”)
16
>>>eval(‘a+10’)
17
https://education.ti.com/html/webhelp/EG_TI84PlusCE-T/ES/content/eg_pythonappprog/m_pyref/m_e.HTML
不行:这行不通。查看评论。
安装后 Ndless and khicas
into my two calculators TI Nspire CX CAS II
and TI Nspire CX CAS
, in the khicas documentation 描述如下:
Unlike adaptations of Micro-Python by calculator manufacturers (including Casio), the Python syntax in Xcas is fully integrated. You can therefore use all Xcas commands and data types in your programs. This corresponds approximatively to importing Python modules math, cmath, random, scipy, numpy, turtle, giacpy. There is also a small pixelised graphic commands set (set_pixel(x,y,c), set_pixel() to synchronize display, clearscreen(), draw_line(x1,y1,x2,y2,c), draw_polygon([[x1,y1],[x2,y2],...],c), draw_rectangle(x,y,w,h,c), draw_circle(x,y,r,c), the color+width+filled c parameter is optional, draw_arc(x,y,rx,ry,t1,t2,c) draws an ellipsis arc). And you can somewhat replace matplotlib with graphic commands of χ CAS (point, line, segment, circle, barplot, histogram and all ...plot... commands). Plus you have natural access to data types like rationnals or expressions, and you can run CAS commands on them. The complete list of commands available on the calculator is given in appendix. For documentation on commands not listed in the catalog categories, please refer to Xcas documentation.
目前TI Nspire CX CAS II
,其python环境无法调用nspire内置的数学函数。