今天要用bootstrap开发一个网页,要使用到JSON,但是JSON的格式不正确,然后在http://www.bejson.com/[Be JSON]中测试了一下JSON. 发现JSON中多了一个换行符,然后在输入库中清掉换行符就得到正确的JSON格式了.在Windows或者是SQL中的换行符都是以\r\n存在的,所有使用 Replace()函数置换就行.在Ascii码中,\n是10,\r是13 Update Table Set Column1=Replare(Column1,),'') Up
文件 readlines 列表 readline 字符串 read 字符串 列表---拆分---小列表 f=file('test.log','r') for line in f.readlines(): print line.strip('\n').split(':') 字符串 l='a:b:c:d' l.split(':') ['a', 'b', 'c', 'd'] 打印文件第一列: for i in f.readlines(): print i.split(':')[0] f
基本数据类型 一.整型 如: 18.73.84 整型具备如下功能: class int(object): """ int(x=0) -> int or long int(x, base=10) -> int or long Convert a number or string to an integer, or return 0 if no arguments are given. If x is floating point, the conversion tr