鱼C论坛

 找回密码
 立即注册
查看: 1658|回复: 1

[已解决]第35讲第1题

[复制链接]
发表于 2017-6-18 13:56:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

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)

最佳答案
2017-6-18 18:06:04
  1. multenterbox is a simple way of showing multiple enterboxes on a single screen.

  2. _images/screenshot_multenterbox_vista.png
  3. In the multenterbox:

  4. 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.
  5. If there are more values than names, the list of values is truncated so that there are as many values as names.
  6. 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循环里面就是对每一个字段的值进行检查,就是列表切片取出,然后去除空格以后和空格对比。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2017-6-18 18:06:04 | 显示全部楼层    本楼为最佳答案   
  1. multenterbox is a simple way of showing multiple enterboxes on a single screen.

  2. _images/screenshot_multenterbox_vista.png
  3. In the multenterbox:

  4. 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.
  5. If there are more values than names, the list of values is truncated so that there are as many values as names.
  6. 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循环里面就是对每一个字段的值进行检查,就是列表切片取出,然后去除空格以后和空格对比。
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-19 23:24

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表