会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
长456风
上一页
1
···
10
11
12
13
14
15
16
17
18
···
22
下一页
2015年4月1日
windows程序调试
摘要: 由于不能在控制台输出,可以使用Messagebox 但是有时候要用到输出int之类的,需要转换。转换过程中有会有很多问题。 这里给出两个可行的代码 int a = 5, b = 10; int result = getMax(a, b); WCHAR tmp[8]; wsprintf(...
阅读全文
posted @ 2015-04-01 19:15 长456风
阅读(159)
评论(0)
推荐(0)
2015年3月20日
python有序字典
摘要: dict = {'a':7,'b':3,'c':4,'d':1,'e':8,}print dictorder_dict = collections.OrderedDict()order_dict['a'] = 1order_dict['b'] = 2print order_dictprint o...
阅读全文
posted @ 2015-03-20 17:05 长456风
阅读(175)
评论(0)
推荐(0)
value是列表的字典排序
摘要: # -*- coding: utf-8 -*-def dict_test(): #构造Map并对其排序 attr_tul = list(['a','b','c']) one_tul = list([[3,4],[1,9],[2,5]]) one_dic = {} f...
阅读全文
posted @ 2015-03-20 14:26 长456风
阅读(223)
评论(0)
推荐(0)
构造Map并对其排序
摘要: #构造Map并对其排序attr_tul = ['a','b','c','d','e','f']one_tul = [1,3,2,5,8,4]one_dic = {}for i in range(len(attr_tul)): one_dic[attr_tul[i]] = one_tul[i...
阅读全文
posted @ 2015-03-20 12:58 长456风
阅读(119)
评论(0)
推荐(0)
2015年3月19日
python读取文件时遇到非法字符的处理 UnicodeDecodeError: 'gbk' codec can't decode bytes in position
摘要: 报错UnicodeDecodeError: 'gbk' codec can't decode bytes in position ipath = 'D:/学习/语料库/SogouC.mini/Sample/C000013/18.txt'uipath = unicode(ipath , "u...
阅读全文
posted @ 2015-03-19 22:18 长456风
阅读(811)
评论(0)
推荐(0)
2015年3月12日
python正则表达式 分割字符串
摘要: 使用或 标准的正则表达式有小括号,但是python的没有 # -*- coding: utf-8 -*-import sysimport reimport sysreload(sys)sys.setdefaultencoding( "utf-8" )if __name__ == '__main...
阅读全文
posted @ 2015-03-12 20:41 长456风
阅读(1399)
评论(0)
推荐(0)
2015年3月11日
python3 导入模块
摘要: python3导入模块和python2 有些不同 需要指定相对目录 如,在Project下有一个nlp目录里面有一个ltp模块,则 from n1.ltp import Clawer
阅读全文
posted @ 2015-03-11 20:01 长456风
阅读(189)
评论(0)
推荐(0)
python3 以utf-8编码写文件
摘要: 原来的 save = open('1.txt', 'w', 'utf8') 用下面的 save = codecs.open('1.txt', 'w', 'utf8')
阅读全文
posted @ 2015-03-11 19:35 长456风
阅读(1317)
评论(0)
推荐(0)
python 3 爬虫
摘要: import urllib.request url = "http://www.oschina.net/" data = urllib.request.urlopen(url).read() print(data) ''' Created on 2013-1-...
阅读全文
posted @ 2015-03-11 19:10 长456风
阅读(192)
评论(0)
推荐(0)
2015年3月9日
使用pycharm编写python乱码
摘要: 开始总是乱码,该设置的都设置了,后来用charde检测编码也一直报错,之后重启了pycharm就好了,乱码问题也没了
阅读全文
posted @ 2015-03-09 22:33 长456风
阅读(233)
评论(0)
推荐(0)
上一页
1
···
10
11
12
13
14
15
16
17
18
···
22
下一页
导航
博客园
首页
新随笔
联系
订阅
管理
公告