在test.log写入字符串类容:'''f = open("test.log","w")f.write("this is the first line\n")f.write("this is the second line\n")f.write("this is the 3 line\n")f.wr ...
分类:
编程语言 时间:
2017-10-16 19:47:18
阅读次数:
188
文件操作文件操作流程 1、打开文件,得到文件句柄并赋值给一个变量 2、通过句柄对文件进行操作 3、关闭文件现有文件如下: Somehow, it seems the love I knew was always the most destructive kind 不知为何,我经历的爱情总是最具毁灭性 ...
分类:
编程语言 时间:
2017-10-16 19:29:38
阅读次数:
208
time t = time.localtime(time.time()-86400)# 返回本地时间 print(t.tm_year, t.tm_mon) # 时间戳 time.time() # 格式化前一天时间 t = time.localtime(time.time()-86400) time. ...
分类:
编程语言 时间:
2017-10-16 18:03:35
阅读次数:
229
有如下文本 Symbol,Price,Date,Time,Change,Volume "AA",39.48,"6/11/2007","9:36am",-0.18,181800 "AIG",71.38,"6/11/2007","9:36am",-0.15,195500 "AXP",62.58,"6/1 ...
分类:
其他好文 时间:
2017-10-16 17:56:35
阅读次数:
289
在技术方面,我自己热衷于 Open Source,写了很多 Open Source 的东西,擅长的是 Infrastructure 领域。Infrastructure 领域现在范围很广,比如说很典型的分布式 Scheduler、Mesos、Kubernetes,另外它和 Microservices ...
分类:
数据库 时间:
2017-10-16 16:43:32
阅读次数:
193
Python标准库中提供了三种用来分析程序性能的模块,分别是cProfile, profile和hotshot,另外还有一个辅助模块stats。这些模块提供了对Python程序的确定性分析功能,同时也提供了相应的报表生成工具,方便用户快速地检查和分析结果 cProfile:基于lsprof的用C语言 ...
分类:
编程语言 时间:
2017-10-16 16:40:32
阅读次数:
238
准备材料 1、注册账号 https://open.unionpay.com/ajweb/register?locale=zh_CN 2、▼登录账号 -->帮助中心--> 下载,选择网关支付,下载网管支付产品技术开发包,里面有一些文档,你也可以下载下来看看。 3、开发工具Eclipse+Tomcat7 ...
分类:
编程语言 时间:
2017-10-16 16:27:10
阅读次数:
228
r模式:默认模式,文件不存在则报错 f=open('a.txt',encoding='utf-8') # 打开方式为utf-8,操作系统默认为gbk,以什么编码存的就以什么编码打开,前提是有这个文件,不然报错 print('first-read:',f.read()) # read 全读,读完光标就 ...
分类:
其他好文 时间:
2017-10-16 15:04:32
阅读次数:
166
1 f=open('my_heart_will_go_on','r',encoding='utf-8') 2 f_new=open('my_heart_will_go_on.bak','w',encoding='utf-8') 3 for line in f: 4 if 'Once more you ...
分类:
其他好文 时间:
2017-10-16 13:57:09
阅读次数:
109
1.安装gerrit replication插件 解决方法:Open YOUR_GERRIT_DIR/etc/gerrit.config file and add the following entry: ...
分类:
其他好文 时间:
2017-10-16 13:45:52
阅读次数:
382