E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
python字符串
关于python的编码总结
python的编码格式的转换,常用的方法 Unicode字符串可以用多种方式编码为普通字符串,依照你所选择的编码(encoding): Togglelinenumbers1#将Unicode转换成普通的
Python
jenguo
·
2011-12-14 19:20
python
字符串
Python字符串
join使用示例
#元组tuple和列表list的相互转换 #使用for遍历序列,使用下标访问序列 #字符串操作join方法使用(其他如find等方法使用) deffunc(seq): sql="select" aaa=seq #delimiter=',' #aaa=delimiter.join(seq) #printaaa j=0 foriinaaa: aaa[j]="@demo_proc"+str(i) j=j
gukesdo
·
2011-12-14 16:00
GOOGLE大学教程之
Python字符串
Python字符串
谷歌代码大学 > 编程语言Python有一个内置的字符串类,名为“STR”与许多方便的功能(有一个名为“字符串”,你不应该使用的旧的模块)。
haha_mingg
·
2011-12-14 15:00
java
工作
python
正则表达式
Google
测试
Python字符串
处理
原文链接 http://apps.hi.baidu.com/share/detail/15536521
python字符串
处理 转载至: http://hi.baidu.com
qingwu
·
2011-12-07 11:00
python
Python字符串
比较忽略大小写的方法
A.正则表达式,使用IGNORECASE标志>>>importre >>>m=re.search('multi','AmUltiCasedstring',re.IGNORECASE) >>>bool(m) TrueB.在比较前把2个字符串转换成同样大写,用upper()方法,或小写,lower()>>>s='AmUltiCasedstring'.lower() >>>s 'amultic
summerhust
·
2011-11-11 16:00
正则表达式
python
String
import
reference
python字符串
http://blog.csdn.net/tianlesoftware/article/details/6753112#encoding=utf-8#序列:字符串、列表和元组#*******************************************#***************** 字符串 ****************#*************************
jiedushi
·
2011-11-10 07:00
oracle
正则表达式
python
Integer
input
语言
python字符串
专题 以及Unicode应用小例子
''' Created on 2011-9-29 @author: xgzhao ''' # The repetition of sequence seq*expr seq = ['a', 'b', 'c', 'd'] print seq*2 #cut the last alphabet each time #range(3) returns a sequence [0, 1, 2] s = 'a
webcode
·
2011-09-29 11:00
unicode
python字符串
专题 以及Unicode应用小例子
''' Created on 2011-9-29 @author: xgzhao ''' # The repetition of sequence seq*expr seq = ['a', 'b', 'c', 'd'] print seq*2 #cut the last alphabet each time #range(3) returns a sequence [0, 1, 2] s = 'a
txf2004
·
2011-09-29 11:00
unicode
python字符串
专题 以及Unicode应用小例子
''' Created on 2011-9-29 @author: xgzhao ''' # The repetition of sequence seq*expr seq = ['a', 'b', 'c', 'd'] print seq*2 #cut the last alphabet each time #range(3) returns a sequence [0, 1, 2] s = 'a
txf2004
·
2011-09-29 11:00
unicode
Python字符串
操作
Python字符串
操作 python如何判断一个字符串只包含数字字符 python 字符串比较 http://www.pythonclub.org/python-basic/string 下面列出了常用的
wangqiaowqo
·
2011-09-22 10:00
python
Python字符串
操作
Python字符串
操作 python如何判断一个字符串只包含数字字符 python 字符串比较 http://www.pythonclub.org/python-basic/string 下面列出了常用的
wangqiaowqo
·
2011-09-22 10:00
python
Python字符串
的encode与decode研究心得――解决乱码问题
为什么Python使用过程中会出现各式各样的乱码问题,明明是中文字符却显示成“/xe4/xb8/xad/xe6/x96/x87”的形式?为什么会报错“UnicodeEncodeError:'ascii'codeccan'tencodecharactersinposition0-1:ordinalnotinrange(128)”?本文就来研究一下这个问题。字符串在Python内部的表示是unicod
clopopo
·
2011-09-21 15:13
python
职场
中文编码
休闲
python字符串
连接
python 字符串连接有几种方法,我开始用的第一个方法效率是最低的,后来看了书以后就用了后面的 2种效率高的方法,希望对大家有帮助。 先介绍下效率比较低的方法: a = ['a','b','c','d'] content = '' for i in a: content = content + i print content content的结果是:'abcd' 后来我看了书以后,发现书上说的
lovebirdegg
·
2011-08-23 17:00
python
Python字符串
的encode与decode研究心得乱码问题解决方法
为什么Python使用过程中会出现各式各样的乱码问题,明明是中文字符却显示成“\xe4\xb8\xad\xe6\x96\x87”的形式?为什么会报错“UnicodeEncodeError:'ascii'codeccan'tencodecharactersinposition0-1:ordinalnotinrange(128)”?本文就来研究一下这个问题。字符串在Python内部的表示是unicod
beautypp
·
2011-08-03 22:13
python
编码
decode
encode
休闲
python字符串
之符合字段名
>>> import humansize >>> si_suffixes=humansize.SUFFIXES[1000] ① >>> si_suffixes [ 'KB' , 'MB' , 'GB' , 'TB' , 'PB' , 'EB' , 'ZB' , 'YB' ] >>> '1
Cain
·
2011-06-30 16:00
python
import
Python 字符串方法详解
Python字符串
方法详解类型方法注解填充center(width[,fillchar]),ljust(width[,fillchar]),rjust(width[,fillchar]),zfill(width
andoring
·
2011-05-18 16:00
JOIN
python
String
table
平台
encoding
python字符串
转成列表
今天在看pygments的代码的时候,发现有一个类是 自生成式的 就是在main方法里面 通过一系列操作写文件 当然 这个文件就是他自己了 其中的代码片段 """ pygments.lexers._mapping ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer mapping definti
qiaoqinqie
·
2011-04-16 17:00
python
SVN
F#
OS
Python字符串
处理函数
在python有各种各样的string操作函数。在历史上string类在python中经历了一段轮回的历史。在最开始的时候,python有一个专门的string的module,要使用string的方法要先import,但后来由于众多的python使用者的建议,从python2.0开始,string方法改为用S.method()的形式调用,只要S是一个字符串对象就可以这样使用,而不用import。同
wh62592855
·
2011-02-28 15:00
python
String
list
Module
import
encoding
python字符串
与数字的转化
字符串转化为数字 #coding=gbk#字符串转化为实数defstrtonum(s,defaultValue=0): try: f=float(s) except: f=defaultValue returnf#字符串转化为整数defstrtoint(s,defaultValue=0): try: f=int(s) exc
wellwy
·
2011-02-12 16:49
python
职场
休闲
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串
天梯梦
·
2011-02-10 05:00
python
ide
python字符串
处理2
Python中String类型的用法。这一部分我主要是整理一些思路。网上已经有很多朋友分享了Python中String类型的用法。 String的表现形式1: 'me'单引号2: "me"双引号 前面两种方式的配合,很有Javascript中的感觉。这样写的确是方便很多。在底层Python编译器会统一成
redwolf888
·
2011-01-06 13:00
JavaScript
C++
c
python
C#
python字符串
处理
#!/usr/bin/python# -*- coding: utf-8 -*-from string import *import sysimport tracebackif __name__ == '__main__':str = "gaBriel woNg"chn = "王钟沛"#"Gabriel"和"Wong"
redwolf888
·
2011-01-06 13:00
python
Python字符串
的encode与decode 转载
Python字符串
的encode与decode2008-04-2000:58:38bydeepblue首先要搞清楚,字符串在Python内部的表示是unicode编码,因此,在做编码转换时,通常需要以unicode
zhonghua
·
2010-11-27 15:00
Python 正则表达式二
一、字符串 1.
python字符串
通常有单引号('...')、双引号("...")、三引号("""...
诗意的栖居
·
2010-11-04 15:00
正则表达式
python
Python字符串
类
1、复制字符串 str2 = str1 2、链接字符串 str += "abc" 3、查找字符串 string.find(sub) string.index(sub) s
andylin02
·
2010-10-21 15:00
python
Python字符串
操作的性能测试
关于
python字符串
处理简单优化importtimedefmain1(): st=time.clock() s="" forxinrange(20000):
flandycheng
·
2010-09-09 17:32
性能
python
职场
休闲
python 字符串学习
#
Python字符串
操作 '''1.复制字符串''' #strcpy(sStr1,sStr2) sStr1 = 'strcpy' sStr2 = sStr1 sStr1 = 'strcpy2
Zsb007
·
2010-08-22 15:00
C++
c
python
C#
python学习小结
python字符串
: 字符串在python中是一个单个字符的字符串的序列,可以对字符串进行切片连接等相关操作。 下面是关于
python字符串
的一些文章:python 字符串替
m4774411wang
·
2010-06-20 17:00
编程
C++
c
python
C#
Python 字符串操作
Python字符串
操作#
Python字符串
操作'''1.复制字符串'''#strcpy(sStr1,sStr2)sStr1 = 'strcpy'sStr2 = sStr1sStr1 = 'strcpy2
杰森
·
2010-06-19 15:00
python字符串
替换的2种方法
python 字符串替换 是python 操作字符串的时候经常会碰到的问题,这里简单介绍下字符串替换方法。 python 字符串替换可以用2种方法实现: 1是用字符串本身的方法。 2用正则来替换字符串 下面用个例子来实验下: a = 'hello word' 我把a字符串里的word替换为python 1用字符串本身的replace方法 a.replace('word','python') 输出
m4774411wang
·
2010-05-31 17:00
正则表达式
python
python字符串
中你可能不会注意的地方
python字符串
连接 有几种方法,我开始用的第一个方法效率是最低的,后来看了书以后就用了后面的 2种效率高的方法,希望对大家有帮助。
m4774411wang
·
2010-05-31 17:00
C++
c
python
C#
python字符串
操作(连接、比较、格式化等)
字符串连接 方法一: >>> str1 = 'hello' >>> str2 = 'world' >>> str1_2 = str1 + ' ' + str2 >>> str1_2 'hello world' >>> print str1_2 hello world >>&g
canlynet
·
2010-05-25 17:00
C++
c
python
C#
Python字符串
操作[转]
Python字符串
操作python如何判断一个字符串只包含数字字符
python字符串
比较 下面列出了常用的python实现的字符串操作1.复制字符串#strcpy(sStr1,sStr2) sStr1
cccAllen
·
2010-05-25 13:00
c
python
python字符串
s = "woxiaoe" print len(s) print "s[0] " + s[0] + '\t' + 's[1] ' + s[1]; print "s[-1] " + s[-1] + '\t' + 's[-2] ' + s[-2]; print s*10 print 'asS'.isalpha(
woxiaoe
·
2010-03-25 01:00
python
Scheme
python 字符串使用总结
1.
python字符串
通常有单引号(’…’)、双引号(”…”)、三引号(”"”…”"”)或(”’…”’)包围,三引号包含的字符串可由多行组成,一般可表示大段的叙述性字符串。
Java2King
·
2010-03-24 15:00
c
python
import
python字符串
解析,利用string模块和正则表达式re模块
1.
python字符串
通常有单引号('...')、双引号("...")、三引号("""...
alanland
·
2010-03-15 13:00
C++
c
python
正则表达式
C#
Python字符串
的encode与decode
decode的作用是将其他编码的字符串转换成unicode编码,如str1.decode('gb2312'),表示将gb2312编码的字符串转换成unicode编码。 encode的作用是将unicode编码转换成其他编码的字符串,如str2.encode('gb2312'),表示将unicode编码的字符串转换成gb2312编码。在某些IDE中,字符串的输出总是出现乱码,甚至错误,其实是由于ID
xiaolin0199
·
2010-02-02 10:00
python
ide
(转)
Python字符串
的encode与decode研究心得——解决乱码问题
为什么Python使用过程中会出现各式各样的乱码问题,明明是中文字符却显示成“/xe4/xb8/xad/xe6/x96/x87”的形式?为什么会报错“UnicodeEncodeError:'ascii'codeccan'tencodecharactersinposition0-1:ordinalnotinrange(128)”?本文就来研究一下这个问题。字符串在Python内部的表示是unico
shiwei0124
·
2010-01-15 14:00
python字符串
使用总结
1.python 字符串通常有单引号('...')、双引号("...")、三引号("""...""")或('''...''')包围,三引号包含的字符串可由多行组成,一般可表示大段的叙述性字符串。在使用时基本没有差别,但双引号和三引号("""...""")
sinfrancis
·
2010-01-14 11:00
C++
c
python
C#
ide
python字符串
处理函数
在python有各种各样的string操作函数。在历史上string类在python中经历了一段轮回的历史。在最开始的时候,python有一个专门的string的module,要使用string的方法要先import,但后来由于众多的python使用者的建议,从python2.0开始, string方法改为用S.method()的形式调用,只要S是一个字符串对象就可以这样使用,而不用import。
bbsunchen
·
2009-12-19 16:00
正则表达式
python
Python字符串
操作
#
Python字符串
操作'''1.复制字符串'''#strcpy(sStr1,sStr2)sStr1='strcpy'sStr2=sStr1sStr1='strcpy2'printsStr2'''2.
nrs12345
·
2009-11-25 12:00
c
python
Python字符串
的encode与decode
首先要搞清楚,字符串在Python内部的表示是unicode编码. 因此,在做编码转换时,通常需要以unicode作为中间编码,即先将其他编码的字符串解码(decode)成unicode,再从unicode编码(encode)成另一种编码。 decode的作用是将其他编码的字符串转换成unicode编码, 如str1.decode('gb2312'),表示将gb2312编码的字符
xanderzhang
·
2009-09-10 10:00
python
ide
Python 字符串 转换 整数 浮点数 数字
Python字符串
转换整数浮点数数字>>> import string>>> string.atoi('34')34>>> int('34')34&
悄然无声的Blog
·
2009-05-07 11:00
python中对字符串的操作使用总结
1.
python字符串
通常有单引号('...')、双引号("...")、三引号("""...""")或('''...''')包围,三引号包含的字符串可由多行组成,一般可表示大段的叙述性字符串。
cai555
·
2009-04-20 16:00
Python
C
C++
C#
python中对字符串的操作使用总结
1.
python字符串
通常有单引号('...')、双引号("...")、三引号("""...
cai555
·
2009-04-20 16:00
C++
c
python
C#
上一页
47
48
49
50
51
52
53
54
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他