[python程序]附下载,函数绘图,可在手机上输入函数,并画出函数图像

此程序又CNPDA的dozer47528编写。
虽然作者是为S60V2的,不过S60V3的朋友可以用ped打开程序再运行,效果是一样的。
引用内容 引用内容
说明:
画多函数,最多五条
快速移动,查看函数
放大缩小(重绘图像比较慢)
最有用的功能!移动一个点可以查看坐标!
完美支持三角正弦函数,余弦函数,不完美支持正切函数…
输入格式: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()


原贴地址:这里
完整代码下载:draw 1.5.py


[本日志由 admin 于 2010-09-01 10:58 AM 编辑]
文章来自: 转载
引用通告: 查看所有引用 | 我要引用此文章
Tags: python s60V3
相关日志:
评论: 1 | 引用: 0 | 查看次数: 1401
回复回复庄臣[2009-04-09 02:43 PM | del]
代码呢
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 200 字 | UBB代码 关闭 | [img]标签 关闭