- 博客(11)
- 资源 (3)
- 问答 (2)
- 收藏
- 关注
原创 一个简单的界面,使用wxpython
import wxapp=wx.App()win=wx.Frame(None,title="jisuanqi")bkg=wx.Panel(win)screen=wx.TextCtrl(bkg)btn7=wx.Button(bkg,label="7")btn8=wx.Button(bkg,label="8")btn9=wx.Button(bkg,label="9")btn4=wx
2014-04-30 11:00:47 824
原创 MonkeyRunner常用类方法
MonkeyRunner的一些常用方法:(详细参考:http://developer.android.com/tools/help/MonkeyRunner.html)void alert (string message, string title, string okTitle)弹出一个对话框,默认标题“警告”,按钮显示“确定”,可暂停当前的程序例:MonkeyRunner.al
2014-04-26 14:31:28 1373
转载 ADB常用命令说明
Android Debug Bridge(adb)adb [-d|-e|-s ] -d 连接到当前真实设备。若当前连接真实设备大于一,则报错-e 连接到当前虚拟设备。若当前连接虚拟设备大于一,则报错-s 连接到特定设备,需指定设备名例如:adb -s emulator-5556 install helloWorld.apk通过命令可查询设备名称 adb devices
2014-04-25 17:54:26 686
转载 文件处理的一些方法
复制文件:with open("1.txt","r") as f: lines = f.readlines()with open("2.txt","w") as f: f.writelines(lines)使用with xxx as xx: 可以安全的关闭文件
2014-04-23 16:45:09 509
转载 一个简单提取邮件地址的方法
# -*- coding: cp936 -*-import fileinput,re path=r"C:\Users\Administrator\Desktop\423\test.txt"pat=re.compile(r"发件人\:(.+?)\")pat2=re.compile(r"\")addr=set()for line in fileinput.input(path):
2014-04-23 14:01:21 2421
转载 shelve函数
# -*- coding: cp936 -*-import sys,shelvedef main(): database = shelve.open("d:\\test.dat") try: while True: cmd = getcmd() if cmd == "s": stor
2014-04-22 10:18:19 760
原创 关于random的一些例子
# -*- coding: cp936 -*-from random import *#num = input("请输入骰子数:")#dian = input("请输入骰子具有面数:")def tou(num,dian): count=0 for i in range(num): count += randrange(1,dian+1)
2014-04-21 17:25:16 720
转载 八皇后问题解法,参考教程
# -*- coding: cp936 -*-def queen(num=8,state=()): for pos in range(num): if not conflict(state,pos): if len(state)== num-1: yield (pos,) else
2014-04-18 14:23:20 602
原创 二分法猜测100以内数字
def f(low,high,guess,count): count[0] += 1 mid = int(low + (high-low)/2) if mid==guess: return elif mid>guess: high = mid return f(low,high,guess,count)
2014-04-15 16:15:59 1476
原创 用于转换url的斜线,python实现
path = raw_input("enter a url:")if '/' in path: print path.replace('/','\\')if '\\' in path: print path.replace('\\','/')ok=raw_input('press enter')
2014-04-14 16:39:31 972
HTMLTestRunner.py
2016-05-26
使用seek方式创建的文件,为什么默认打开编码是ANSI?
2019-05-23
xpath如何选择不包含特定子节点的节点?
2019-01-02
TA创建的收藏夹 TA关注的收藏夹
TA关注的人