2018年1月13日

re 模块

摘要: http://blog.csdn.net/lxcnn/article/details/4146148 https://www.crifan.com/detailed_explanation_about_python_regular_express_match_named_group/ 阅读全文

posted @ 2018-01-13 21:33 dotiger 阅读(180) 评论(0) 推荐(0)

shlve模块 序列化 python任意的数据

摘要: import shelved = shelve.open('shelve_test') # 打开一个文件class Test(object): def __init__(self, n): self.n = nt = Test(123)t2 = Test(123334)name = ["alex", 阅读全文

posted @ 2018-01-13 19:13 dotiger 阅读(197) 评论(0) 推荐(0)

json 模块

摘要: import json # json 可以在各个语言中通用 只支持最简单的数据类型 字符串 列表等数据def sayhi (name): print('hello',name)info = { 'name':'alex', 'age':'23', 'sex': '1'}f = open('test. 阅读全文

posted @ 2018-01-13 18:41 dotiger 阅读(103) 评论(0) 推荐(0)

python os sys moudle

摘要: import os ,sysprint(os.getcwd()) ##获取当前工作目录,即当前python脚本工作的目录路径os.chdir("atm") #改变当前脚本工作目录;相当于shell下cdprint(os.getcwd()) ##获取当前工作目录,即当前python脚本工作的目录路径# 阅读全文

posted @ 2018-01-13 16:40 dotiger 阅读(124) 评论(0) 推荐(0)

time and datatime

摘要: import time# print(sys.path)## # os.path.abspath(__file__) 表示的是获取当前文件的绝对路径## #os.path.dirname 表示获取当前目录文件的上一层的文件路径## print(os.path.dirname(os.path.abspath(__file__)))# print(time.clock()) #返... 阅读全文

posted @ 2018-01-13 16:14 dotiger 阅读(105) 评论(0) 推荐(0)

python 模块的导入

摘要: 模块导入: 1、 模块导入的方法 : import moudule_name import moudule1_name,moudule2_name from moudule_name import * from moudule_name import m1,m2,m3 from moudule_na 阅读全文

posted @ 2018-01-13 15:26 dotiger 阅读(116) 评论(0) 推荐(0)

导航