[python程序]附下载,函数绘图,可在手机上输入函数,并画出函数图像
作者:admin 日期:2007-12-13
此程序又CNPDA的dozer47528编写。
虽然作者是为S60V2的,不过S60V3的朋友可以用ped打开程序再运行,效果是一样的。
引用内容
虽然作者是为S60V2的,不过S60V3的朋友可以用ped打开程序再运行,效果是一样的。
引用内容说明:
画多函数,最多五条
快速移动,查看函数
放大缩小(重绘图像比较慢)
最有用的功能!移动一个点可以查看坐标!
完美支持三角正弦函数,余弦函数,不完美支持正切函数…
输入格式:x^2+sin(x)+cos(x)+tan(x)-1/x+x*5
画多函数,最多五条
快速移动,查看函数
放大缩小(重绘图像比较慢)
最有用的功能!移动一个点可以查看坐标!
完美支持三角正弦函数,余弦函数,不完美支持正切函数…
输入格式:x^2+sin(x)+cos(x)+tan(x)-1/x+x*5
复制内容到剪贴板
程序代码
程序代码部分代码预览:
import appuifw
import graphics
import e32
import math
from key_codes import *
#==========定义函数
#==========定义按键事件
class Keyboard(object):
def __init__(self,onevent=lambda:None):
self._keyboard_state={}
self._downs={}
self._onevent=onevent
def handle_event(self,event):
if event['type'] == appuifw.EEventKeyDown:
code=event['scancode']
if not self.is_down(code):
self._downs[code]=self._downs.get(code,0)+1
self._keyboard_state[code]=1
elif event['type'] == appuifw.EEventKeyUp:
self._keyboard_state[event['scancode']]=0
self._onevent()
def is_down(self,scancode):
return self._keyboard_state.get(scancode,0)
def pressed(self,scancode):
if self._downs.get(scancode,0):
self._downs[scancode]-=1
return True
return False
keyboard=Keyboard()
import appuifw
import graphics
import e32
import math
from key_codes import *
#==========定义函数
#==========定义按键事件
class Keyboard(object):
def __init__(self,onevent=lambda:None):
self._keyboard_state={}
self._downs={}
self._onevent=onevent
def handle_event(self,event):
if event['type'] == appuifw.EEventKeyDown:
code=event['scancode']
if not self.is_down(code):
self._downs[code]=self._downs.get(code,0)+1
self._keyboard_state[code]=1
elif event['type'] == appuifw.EEventKeyUp:
self._keyboard_state[event['scancode']]=0
self._onevent()
def is_down(self,scancode):
return self._keyboard_state.get(scancode,0)
def pressed(self,scancode):
if self._downs.get(scancode,0):
self._downs[scancode]-=1
return True
return False
keyboard=Keyboard()
复制内容到剪贴板
程序代码
程序代码评论: 1 | 引用: 0 | 查看次数: 1401
回复
]代码呢
发表评论
上一篇
下一篇


文章来自:
Tags:
相关日志:
