本文整理汇总了Python中java.lang.String.trim方法的典型用法代码示例。如果您正苦于以下问题:Python String.trim方法的具体用法?Python String.trim怎么用?Python String.trim使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.lang.String
的用法示例。
在下文中一共展示了String.trim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parameterScan
# 需要导入模块: from java.lang import String [as 别名]
# 或者: from java.lang.String import trim [as 别名]
def parameterScan():
global scan_device_server_name
global scan_1d_front
global scan_2d_front
global path
global data_file
global file_extension
global actuators
global sensors
global n_steps
global integration_time
global start_position_actuators_1D
global end_position_actuators_1D
global n_steps2
global start_position_actuators_2D
global end_position_actuators_2D
global timebase
global scan_number
global scan_type
global has_trajectory
global file_path
global actuators2D
#open the file in read only mode
#file = DataInputStream(FileInputStream("D:\eclipse\workspace\passerelle-soleil\sample-models\paramscan.txt"))
file = open(file_path,'r')
parameters = {}
for line in file.readlines():
#print "line ",line
tokens = line.split('=')
#print "tokens ",tokens
if(len(tokens) == 2):
tok0 = String(tokens[0])
tok1 = String(tokens[1])
tok0 = tok0.trim()
tok1 = tok1.trim()
parameters[tok0] = tok1
print tok0,":",tok1
if(parameters.has_key("scan_device_server_name")):
scan_device_server_name = parameters["scan_device_server_name"]
if(parameters.has_key("scan_1d_front")):
scan_1d_front = parameters["scan_1d_front"]
if(parameters.has_key("scan_2d_front")):
scan_2d_front = parameters["scan_2d_front"]
if(parameters.has_key("path")):
path = parameters["path"]
if(parameters.has_key("data_file")):
data_file = parameters["data_file"]
if(parameters.has_key("file_extension")):
file_extension = parameters["file_extension"]
if(parameters.has_key("actuators")):
actuators = parameters["actuators"].split(",")
#print "parameterScan actuators ",parameters["actuators"].split(",")
if(parameters.has_key("sensors")):
sensors = parameters["sensors"].split(",")
#if(parameters.has_key("n_steps")):
#n_steps = Integer.parseInt(parameters["n_steps"])
#if(parameters.has_key("integration_time")):
#integration_time = Double.parseDouble(parameters["integration_time"])
#if(parameters.has_key("start_position_actuators_1D")):
# stringTable = parameters["start_position_actuators_1D"].split(",")
# start_position_actuators_1D = []
# for i in stringTable:
# start_position_actuators_1D.append(Double.parseDouble(i))
if(parameters.has_key("end_position_actuators_1D")):
stringTable = parameters["end_position_actuators_1D"].split(",")
end_position_actuators_1D = []
for i in stringTable:
end_position_actuators_1D.append(Double.parseDouble(i))
if(parameters.has_key("actuators2D")):
actuators2D = parameters["actuators2D"].split(",")
#print "parameterScan actuators ",parameters["actuators"].split(",")
if(parameters.has_key("n_steps2")):
n_steps2 = Integer.parseInt(parameters["n_steps2"])
if(parameters.has_key("start_position_actuators_2D")):
stringTable = parameters["start_position_actuators_2D"].split(",")
start_position_actuators_2D = []
for i in stringTable:
start_position_actuators_2D.append(Double.parseDouble(i))
if(parameters.has_key("end_position_actuators_2D")):
stringTable = parameters["end_position_actuators_2D"].split(",")
end_position_actuators_2D = []
for i in stringTable:
end_position_actuators_2D.append(Double.parseDouble(i))
#.........这里部分代码省略.........