- 浏览: 47859 次
- 性别:
- 来自: 北京
最新评论
文章列表
python 分割字符串,遍历数组的三种方式
- 博客分类:
- python
indata_str="1,2,3,4"
indata_list=indata_str.split(",");
for index in range(len(indata_list)):
print indata_list[index],index
for indata in indata_list:
print indata
for index, indata in enumerate(indata_list):
print indata,index
import urllib
import xml.dom.minidom
url = 'http://223.202.45.187:8080/BillQueryService3/pub/query/billing/LogBandWidthByChannelID?Type=standard&RegionID=9050&ChannelCount=1&StartTime=20130911&EndTime=20130912&ChannelID1=46056'
if __name__ == '__main__':
...
Filtering 功能Filtering 是 Maven Resources Plugin 的一个功能,它会使用系统属性或者项目属性的值替换资源文件(*.properties,*.xml)当中 ${…} 符号的值。比如你系统属性有一项 “user.name=foobar”,那么资源文件当中的 ${user.name} 符号会在 Maven 编译时自动被替换为 “foobar”。
Profile 功能Profile 的作用是允许你在项目文件(pom.xml)里定义若干个 profile 段,然后在编译时选择其中的一个用于覆盖项目文件原先的定义。
<profiles>
...
第一种解决方式:
//设置输入时忽略JSON字符串中存在而Java对象实际没有的属性
2mapper.getDeserializationConfig().set(
3 org.codehaus.jackson.map.DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
另一种解决方式 未测试通过,待确认
在映射对象中增加注解
@JsonSerialize(include = Inclusion.NON_NULL
import urllib
import json
url = 'http://xxx.xxx.xxx.xxx:8888/xxxx-api/customer/qq/channels'
def get_data():
response = urllib.urlopen(url).read()
json_array = json.loads(response)
channel = {}
for json_map in json_array:
channel[json_map['code']] = json_map['name']
...
Created on 2013-8-22
@author: hbjava1985
'''
print 'hello world!'
print "hello world!"
print 'hello %s!' % ('world')
a = 1; b = 2
if(a == b) :
print 'a == b'
elif (a > b) :
print 'a > b'
elif (a < b) :
print 'a < b'
else :
print '#@)#$'
array = ...