|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
以下部分不是很明白,哪位大神请帮忙注释下,谢谢!
while 1:
if fieldValues == None:
break
errmsg = ""
for i in range(len(fieldNames)):
option = fieldNames[i].strip()
if fieldValues[i].strip() == "" and option[0] == "*":
errmsg += ('【%s】为必填项。\n\n' % fieldNames[i])
if errmsg == "":
break
fieldValues = g.multenterbox(errmsg, title, fieldNames, fieldValues)
- multenterbox is a simple way of showing multiple enterboxes on a single screen.
- _images/screenshot_multenterbox_vista.png
- In the multenterbox:
- If there are fewer values than names, the list of values is padded with empty strings until the number of values is the same as the number of names.
- If there are more values than names, the list of values is truncated so that there are as many values as names.
- Returns a list of the values of the fields, or None if the user cancels the operation.
复制代码
Returns a list of the values of the fields,
如果填写了返回的是一个列表,取消了返回None。所以在for前面语句,是在选择取消以后跳出while循环的作用。
for循环里面就是对每一个字段的值进行检查,就是列表切片取出,然后去除空格以后和空格对比。
|
|