随笔分类 -  Python

Eclipse 配置 pyDev(转)
摘要:转自:http://www.51testing.com/html/75/534775-859092.html 很久没有接触到Python了。以前都是在用2.7版本的,这次索性就安装3.2的了。一般的小程序其实自带的IDLE就足够用了。但是其他的或者喜欢用Eclipse的,pydev成了最佳的选择。 阅读全文
posted @ 2016-12-15 14:59 Mr.He多多指教 阅读(328) 评论(0) 推荐(0)
linux与python
摘要:linux一般都装有python,但是版本不一定,需要自己查看,如果版本过低,需要重装。查看python版本方法,直接在命令行输入 python,此时会进入python命令行,同时会显示python版本。 如何退出python命令行,输入exit() 有时我们需要查看python的安装位置,好安装第 阅读全文
posted @ 2016-07-08 14:03 Mr.He多多指教 阅读(2938) 评论(0) 推荐(0)
python 大小写转换方法(全)
摘要:http://blog.csdn.net/liuxincumt/article/details/7945337 python大小写转换(全) 阅读全文
posted @ 2016-06-06 17:37 Mr.He多多指教 阅读(1127) 评论(0) 推荐(0)
把列表变成用指定字符连接的字符串
摘要:def formatResultString(*echoInfo): joinString=',' ResultString = joinString.join(echoInfo[0]) return ResultString x=['lala','oka','woca','end'] print formatResultString(x) #结果:lala,oka,w... 阅读全文
posted @ 2016-05-23 09:53 Mr.He多多指教 阅读(486) 评论(0) 推荐(0)
python 列表、元组操作
摘要:http://www.jb51.net/article/42651.htm 阅读全文
posted @ 2016-05-20 14:45 Mr.He多多指教 阅读(117) 评论(0) 推荐(0)
python正则方法
摘要:通过正则替换字符串 res=re.sub(正则,newString,srcString)//返回替换后的字符串 res,m=res.subn(正则,newString,srcString)//返回替换后的字符串和替换的次数 re.sub(r'.*\x1b\[16D\s*','',echoInfoSt 阅读全文
posted @ 2016-05-05 11:37 Mr.He多多指教 阅读(230) 评论(0) 推荐(0)
python:如何判断字符串中的内容是否都为数字并且把字符串转换为数字
摘要:使用str.isdigit();有两种使用方法 str.isdigit('12345') >True str.isdigit('aaaaa') >False 或者 '12345'.isdigit() >True 'aaaaa'.isdigit() >False 注意 1.使用的是str,而不是str 阅读全文
posted @ 2015-12-23 15:42 Mr.He多多指教 阅读(3198) 评论(0) 推荐(1)
python:字符串的连接
摘要:python中有很多字符串连接方式,今天在写代码,顺便总结一下:最原始的字符串连接方式:str1 + str2 python 新字符串连接语法:str1, str2 奇怪的字符串方式:str1 str2 % 连接字符串:‘name:%s; sex: ' % ('tom', 'male') 字符串列表... 阅读全文
posted @ 2015-12-22 16:03 Mr.He多多指教 阅读(205) 评论(0) 推荐(0)