Python实现简单时间人流数据收集工具
2013-04-12 23:17
891 查看
同事(www.apinglai.com)周末去某克咖啡收集人流数据, 花了点时间弄了个简单的工具给他 。
太久没写python了,感觉手有点生,用到的知识点
由于内容比较少,所以code的比较随便哈哈:)
参考资料: http://www.pythonware.com/library/tkinter/introduction/index.htm http://outofmemory.cn/code-snippet/458/python-decide-caozuoxitong-type-code
太久没写python了,感觉手有点生,用到的知识点
#如何引入module import Tkinter #创建window root = Tkinter.Tk(className="阿平打点软件 V1") #在xy轴200-200的位置创建400*220的窗口 root.geometry("400x220+200+200") #执行system command import os os.system('ping www.pythontab.com') // 返回值是结果 #LINUX获取日期时间的命令 date #echo $(date) # >> 重定向 $python 判断操作系统类型代码 import platform # "Windows" "Linux" platform.system()
由于内容比较少,所以code的比较随便哈哈:)
#encoding:utf-8 # author: richard import platform import os from Tkinter import * inLog = 'C:/inlog.txt' outLog = 'C:/outlog.txt' systemString = platform.system() class App: def __init__(self, master): frame = Frame(master) frame.pack() self.buttonIn = Button(frame, text=" 入 ", command=self.inHandler) self.buttonIn.pack(side=LEFT) self.buttonOut = Button(frame, text=" 出 ", command=self.outHandler) self.buttonOut.pack(side=RIGHT) def inHandler(self): if(systemString =="Windows"): os.system ('echo %time% >> '+inLog) else: os.system ('echo $(date) >> '+inLog) def outHandler(self): if(systemString =="Windows"): os.system ('echo %time% >> '+outLog) else: os.system ('echo $(date) >> '+outLog) root = Tk(className="阿平打点 V1") root.geometry("200x100+200+200") app = App(root) root.mainloop()
参考资料: http://www.pythonware.com/library/tkinter/introduction/index.htm http://outofmemory.cn/code-snippet/458/python-decide-caozuoxitong-type-code
相关文章推荐
- 从Apache的日志文件收集和提供统计数据(一个Python插件架构的简单实现)
- [python] pickle 库 -- 实现数据简单存储
- python实现人人网用户数据爬取及简单分析
- python简单实现获取当前时间
- python简单实现计算过期时间的方法
- Python简单实现TCP包发送十六进制数据的方法
- 三个简单的工具,帮助你收集并优化营销数据
- Python使用shelve模块实现简单数据存储的方法
- 人工智能:python 实现 第十一章,从时间序列数据中提取统计信息
- 常见数据挖掘算法和Python简单实现
- Python使用shelve模块实现简单数据存储的方法
- Python数据可视化正态分布简单分析及实现代码
- python中json格式数据输出的简单实现方法
- Python学习:时间处理工具--dateutil两个简单用法
- 简单Python脚本实现数据导出Excel格式的尝试
- 用python简单实现mysql数据同步到ElasticSearch的教程
- 利用ida python 实现复原函数调用的参数 (仅对数据被简单硬编码有效)
- Python基础(7)——名片管理系统(实现了数据简单的存储、修改、删除、查看等)
- ETL工具kettle怎么实现增量数据抽取:二 时间戳
- python实现人人网用户数据爬取及简单分析