08 2019 档案
摘要:# dic={''} # f=open('test','w') # f.write(dic) #这样是无法将字典写入的 #要将变量转为字符串 # dic={'1:2'} # dic=str(dic) # f=open('test','w') # f.write(dic) # f=open('test','r') # data=f.read() # print(data['1']) #TypeErr
阅读全文
摘要:import configparser config=configparser.ConfigParser #调用系统模块时,不能用其命名文件 #也就是说 可以用.py文件作为一个模块进行调用 #解释器通过搜索路径找到calulate.py(举例)后,将calculate=caluculate.py all code #即calulate.xxxx功能 #同样 也可以从模块中调用一个函数或多个 fr
阅读全文
posted @ 2019-08-19 14:09
zzzi
摘要:import configparser#用于生成和修改常见配置文件config=configparser.ConfigParser()# 第一部分 创建一个配置文件# config=configparser.ConfigParser()## config["DEFAULT"]={'ServerAli
阅读全文
posted @ 2019-08-16 14:45
zzzi
摘要:# s='hello world'# print(s.find('llo'))# #2 为索引# ret=s.replace('ll','xx')# print(ret)# #hexxo world# print(s.split('w'))# #['hello ', 'orld']#string 提
阅读全文
posted @ 2019-08-16 14:41
zzzi
摘要:import logging#常用日志模块#Logger:即 Logger Main Class,是我们进行日志记录时创建的对象,我们可以调用它的方法传入日志模板和信息,来生成一条条日志记录,称作 Log Record。# Log Record:就代指生成的一条条日志记录。# Handler:即用来
阅读全文
posted @ 2019-08-14 20:06
zzzi
摘要:import logging#常用日志模块#Logger:即 Logger Main Class,是我们进行日志记录时创建的对象,我们可以调用它的方法传入日志模板和信息,来生成一条条日志记录,称作 Log Record。# Log Record:就代指生成的一条条日志记录。# Handler:即用来
阅读全文
posted @ 2019-08-14 20:05
zzzi
摘要:import time# print(help(time))# print(time.time())#!常用!# 1565512120.3751876 时间戳 从linux开发到现在#time.sleep(3)#!常用!#print(time.clock())#计算CPU执行时间#print(tim
阅读全文
posted @ 2019-08-12 18:00
zzzi
摘要:import osprint(os.getcwd())#C:\Users\ZzzI\PycharmProjects\untitled2\day18#获取当前工作目录# os.chdir(r'c:\users')#改变当前工作目录print(os.getcwd())#c:\users# print(o
阅读全文
posted @ 2019-08-12 17:59
zzzi

浙公网安备 33010602011771号