03 2017 档案

摘要:import re ''' 函数: findall() #会将所有的匹配的内容输出 search() #返回一个正则的对象 split() #侵害内容 match() #也是将一个符合内容的值给取出来 compile #先将正则表达式给编译出来,然后再用这个编译后的表达式来直接匹配内容 sub() #将匹配出来的内容给替换成一个相关的内容... 阅读全文
posted @ 2017-03-14 20:35 雷神约 阅读(338) 评论(0) 推荐(0)
摘要:# \r 默认表示将输出的内容返回到第一个指针,这样的话,后面的内容会覆盖前面的内容 def main(): for i in range(65,91): s="\r{name:s}".format(name=chr(i)) time.sleep(0.5) sys.stdout.write(s) main() # r 的用法 s="... 阅读全文
posted @ 2017-03-13 17:50 雷神约 阅读(15506) 评论(0) 推荐(1)
摘要:from test import test ''' __mame__ __file__ __cache__ __package__ ''' # import os # 获取这个当前文件的绝对路径 # print(os.path.abspath(__file__)) # abspath=os.path.abspath(__file__) #获取这个文件的名字 # print(os.pa... 阅读全文
posted @ 2017-03-13 16:12 雷神约 阅读(880) 评论(0) 推荐(0)
摘要:# import time # 返回时间戳 # print(time.time()) #返回时间戳 # print(time.gmtime()) #返回utc时间戳 # print(time.localtime(tim... 阅读全文
posted @ 2017-03-12 10:16 雷神约 阅读(1869) 评论(0) 推荐(0)
摘要:1 import time 2 3 # 返回时间戳 4 t=time.time() 5 print(t) name="one"''' bin() oct() hex() bytes() ascii() any() all() abs() bool() str() dict() list() callable() 判断能不能被调用,多数用于函数 char() 将ascii码对应的数... 阅读全文
posted @ 2017-03-09 18:14 雷神约 阅读(171) 评论(0) 推荐(0)
摘要:'''1.lambda 声明一个匿名函数,并且自动给你返回值2.map()3.float()4.globals()5.locals()6.input()7.print()8.int()9.int()10.len()11.open()12.bin13.oct()14.hex()15.tuple()16 阅读全文
posted @ 2017-03-09 16:16 雷神约 阅读(154) 评论(0) 推荐(0)
摘要:name="one"''' bin() oct() hex() bytes() ascii() any() all() abs() bool() str() dict() list() callable() 判断能不能被调用,多数用于函数 char() 将ascii码对应的数转为字符 ord() 将 阅读全文
posted @ 2017-03-09 11:18 雷神约 阅读(202) 评论(0) 推荐(0)