- 博客(15)
- 资源 (1)
- 收藏
- 关注
原创 js
function checkAttr() {var res = true;$("span.font-red").each(function(index, element) {if ($(element).text() === '*') {var reqValue = $(element).closest("label").siblings("div").children("inpu
2015-05-05 15:19:47 417
原创 ex_unitTest.py
'''Created on 2014-12-11@author: xWX238932'''import unittestclass Test(unittest.TestCase): def setUp(self): print("--- setUp ---") pass
2014-12-26 09:02:32 296
原创 s7
#匹配&搜索(正则|re模块)import res = ('xxx', 'abcxxabc', 'xyx', 'abc', 'x.x', 'axxxa', 'axya')a = filter ((lambda s: re.match(r"xxx", s)), s)print(*a)#只会匹配'xxx',不会匹配'axxxa',match()只会从他的开始进行匹配a = fi
2014-12-25 14:08:57 569
原创 s6
#os.walk(top,topdown=True, onerror=None, followlinks=False)参数top表示需要遍历的目录树的路径参数topdown的默认值是"True",表示首先返回目录树下的文件,然后在遍历目录树的子目录;为False时,表示先遍历目录树的子目录,返回子目录下的文件,再返回根目录下的文件参数onerror的默认值是"None",表示忽略文件遍
2014-12-25 14:08:06 539
原创 s5
#文件:import os #os模块open(path, 'w')#打开并写入数据 'a'追加数据 'r'读取(默认参数)f.close()f.readline() 读取一行包含换行符f.read() 读取剩余全部内容f.readlines() 字符串列表os.path.isfile(path) 路径是文件os.path.isdir(path) 路径是目录
2014-12-25 14:05:19 242
原创 com.farmer.gui.ExampleGrid.py
'''Created on 2014-12-11@author: XSD'''from tkinter.constants import E, Wfrom tkinter.tix import Tkfrom tkinter.ttk import Label, Button, Entryfrom tkinter import Menuimport sysi
2014-12-25 13:57:20 290
原创 User.py
'''Created on 2014-10-25@author: XSD'''class User: ''' example class ''' def __init__(self, params={}): ''' 初始化对象 ''' i
2014-12-25 13:52:03 303
原创 FileExp.py
'''Created on 2014-10-30@author: XSD'''import osclass FileExp: ''' example class ''' def __init__(self): ''' 初始化对象 '''#
2014-12-25 13:50:48 325
原创 _strategy.py
'''Created on 2014-10-21@author: XSD# strategy #NOTE:Encoding=UTF-8'''#数值类型不同print(1 == 1.00)print('a' == 'a ')#比较两个字符串分片所涵盖的内容print('a' == 'a')print('# 序列包含的值和顺序相等
2014-12-25 13:47:19 296
原创 _seq_example.py
'''Created on 2014-10-20@author: XSD# sequence #NOTE:Encoding=UTF-8'''print("练习 training")print("hello", "ptyon" + "!")print(type(str(1)) == type(str(1.0)))#元
2014-12-25 13:46:35 360
原创 _function.py
com.farmer.sample_function.py'''Created on 2014-10-22@author: XSD# function #NOTE:Encoding=UTF-8'''#!/usr/bin/env python 3.4.2'''def has_record(): """This
2014-12-25 13:42:40 253
原创 s4
# 其他特性:filter函数:res = filter(lambda x: x%2 == 0, list)print(*res)#输出filtermap函数:res = map(lambda x: "read %s" %x, list)print(*res)#遍历list每个元素range迭代器:range生成一个没有任何方法的对象,它只有内置方法ra
2014-12-25 12:28:20 370 1
原创 s3
类:关键字class User: (类名开头大写)以下划线开头是内部方_init_class stu(user): #扩展stu类,继承user类,可以重写父类中方法note:模块名与实例名不能一致完成模块的工作:1.定义模块特定的异常类2.导出哪些内容。通过__all__可以显示指明可以导出哪些类或函数,__all__ = ["DefException", "ma
2014-12-25 12:24:03 369 1
原创 s2
string模块string.ascii_letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'string.lettersstring.lowercasestring.uppercasestring.digitsString.capwords(S) #首字母大写 列表(list):成员关
2014-12-25 11:07:12 325 3
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人