• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python utils.ask函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utils.ask函数的典型用法代码示例。如果您正苦于以下问题:Python ask函数的具体用法?Python ask怎么用?Python ask使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ask函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: q1

def q1():
    answer = ask(c.red + 'Question 1: What colour are the unicorns?')
    if answer == "pink":
        print('And what a lovely color it is')
        return True
    print('That is incorrect')
    return False
开发者ID:ozjack,项目名称:python-1,代码行数:7,代码来源:pink.py


示例2: q2

def q2():
    7 = ask('how much damige does a diamond
    sowrd do im in the bad spellers club')
    if  rainbows.startswith("7"):
        print('good job!!!!!!!!!!!!!!!')
        return True
    return False
开发者ID:b8conbomber,项目名称:python-1,代码行数:7,代码来源:minecraft.py


示例3: q3

def q3():
    answer = ask("What famous youtuber made a shoutout to him")
    if answer.startswith("pewdipie"):
         print(":)")
         return True
    print(":<")
    return False
开发者ID:iamdurza,项目名称:python-1,代码行数:7,代码来源:thebaws.py


示例4: set_deep_meta_attr_node

def set_deep_meta_attr_node(target_node, attr, value):
    nvpair_l = []
    if xmlutil.is_clone(target_node):
        for c in target_node.iterchildren():
            if xmlutil.is_child_rsc(c):
                rm_meta_attribute(c, attr, nvpair_l)
    if config.core.manage_children != "never" and \
            (xmlutil.is_group(target_node) or
             (xmlutil.is_clone(target_node) and xmlutil.cloned_el(target_node) == "group")):
        odd_children = get_children_with_different_attr(target_node, attr, value)
        for c in odd_children:
            if config.core.manage_children == "always" or \
                    (config.core.manage_children == "ask" and
                     utils.ask("Do you want to override %s for child resource %s?" %
                               (attr, c.get("id")))):
                common_debug("force remove meta attr %s from %s" %
                             (attr, c.get("id")))
                rm_meta_attribute(c, attr, nvpair_l, force_children=True)
    xmlutil.rmnodes(list(set(nvpair_l)))
    xmlutil.xml_processnodes(target_node,
                             xmlutil.is_emptynvpairs, xmlutil.rmnodes)

    # work around issue with pcs interoperability
    # by finding exising nvpairs -- if there are any, just
    # set the value in those. Otherwise fall back to adding
    # to all meta_attributes tags
    nvpairs = target_node.xpath("./meta_attributes/nvpair[@name='%s']" % (attr))
    if len(nvpairs) > 0:
        for nvpair in nvpairs:
            nvpair.set("value", value)
    else:
        for n in xmlutil.get_set_nodes(target_node, "meta_attributes", 1):
            xmlutil.set_attr(n, attr, value)
    return True
开发者ID:icclab,项目名称:crmsh,代码行数:34,代码来源:ui_resource.py


示例5: do_weak_bond

    def do_weak_bond(self, context, *nodes):
        '''
        Create a 'weak' colocation:
        Colocating a non-sequential resource set with
        a dummy resource which is not monitored creates,
        in effect, a colocation which does not imply any
        internal relationship between resources.
        '''
        if len(nodes) < 2:
            context.fatal_error("Need at least two arguments")

        for node in nodes:
            obj = cib_factory.find_object(node)
            if not obj:
                context.fatal_error("Object not found: %s" % (node))
            if not xmlutil.is_primitive(obj.node):
                context.fatal_error("Object not primitive: %s" % (node))

        constraint_name = self.make_unique_name('place-constraint-')
        dummy_name = self.make_unique_name('place-dummy-')
        print "Create weak bond / independent colocation"
        print "The following elements will be created:"
        print "   * Colocation constraint, ID: %s" % (constraint_name)
        print "   * Dummy resource, ID: %s" % (dummy_name)
        if not utils.can_ask() or utils.ask("Create resources?"):
            cib_factory.create_object('primitive', dummy_name, 'ocf:heartbeat:Dummy')
            colo = ['colocation', constraint_name, 'inf:', '(']
            colo.extend(nodes)
            colo.append(')')
            colo.append(dummy_name)
            cib_factory.create_object(*colo)
开发者ID:icclab,项目名称:crmsh,代码行数:31,代码来源:ui_assist.py


示例6: q3

def q3():
    answer =ask(c.magenta + 'should narwhals be the dominant species of the world?')
    if answer == 'yes':
        print('yyyeeeeeaaaahhhh')
        return True
    print('eradicate from the world, }:(========')
    return False
开发者ID:lewington3348,项目名称:python-1,代码行数:7,代码来源:narwhals.py


示例7: q1

def q1():
    answer = ask(c.orange + 'What are the swaggiest animals ever?' + c.reset) 
    if answer =='narwhals':
        print('so nice and purty')
        return True
    print('incorect :(======')
    return False
开发者ID:lewington3348,项目名称:python-1,代码行数:7,代码来源:narwhals.py


示例8: q3

def q3():
    answer = ask("What number is this:1000000?")
    if answer == "1 million":
        print(":)")
        return True
    print(":<")
    return False
开发者ID:jakedasupersnake,项目名称:python-1,代码行数:7,代码来源:myquiz.py


示例9: q1

def q1():
    answer = ask("What is the hardest color to get?")
    if answer == "black":
        print(":)")
        return True
    print(":<")
    return False
开发者ID:lavakiller123,项目名称:python-1,代码行数:7,代码来源:gd.py


示例10: q2

def q2():
    answer = ask("How many letters on a keyboard?")
    if answer == "26":
        print("Super.")
        return True
    print("Nope")
    return False
开发者ID:jakedasupersnake,项目名称:python-1,代码行数:7,代码来源:myquiz.py


示例11: q1

def q1():
    answer = ask("What color are deh Unicorns?")
    if answer == "pink":
        print(derpynessrules.yellow + "Correct! You got it right. Now try to get the next one right!")
        return True
    print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.")
    return False 
开发者ID:GDashBoss,项目名称:python-1,代码行数:7,代码来源:unicornsrule.py


示例12: q3

def q3():
    answer = ask("Use one word to descride their magical fur?")
    if answer.startswith("smiles"):
        print(derpynessrules.yellow + "Correct! You got it right. This is the end of this quiz YEAH!:)")
        return True
    print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.:<")
    return False 
开发者ID:GDashBoss,项目名称:python-1,代码行数:7,代码来源:unicornsrule.py


示例13: q2

def q2():
    answer = ask("What are deh Unicorns dancing on?")
    if answer.startswith("rainbow"):
        print(derpynessrules.yellow + "Correct! You got it right. Now try to get the next one right!")
        return True
    print(derpynessrules.blue + "Oh no! You got it wrong! Try it again.")
    return False 
开发者ID:GDashBoss,项目名称:python-1,代码行数:7,代码来源:unicornsrule.py


示例14: q1

def q1():
    answer = ask("What color are the unicors?") 
    if answer == "pink":
        print("And what a lovely color it is.")
        return True
    print("That is incorrect.")
    return False
开发者ID:iamdurza,项目名称:python-1,代码行数:7,代码来源:fluffy.py


示例15: q2

def q2():
    answer = ask("What level is the hardest of them all?")
    if answer.startswith("theory of everything 2"):
        print(":)")
        return True
    print(":<")
    return False
开发者ID:lavakiller123,项目名称:python-1,代码行数:7,代码来源:gd.py


示例16: q2

def q2(): 
    answer = ask(c.magenta + 'are narwhals swaggy?')
    if answer == 'yes':
        print('yes')
        return True
    print('u make me sad :(=======')    
    return False
开发者ID:lewington3348,项目名称:python-1,代码行数:7,代码来源:narwhals.py


示例17: q3

def q3():
    answer = ask("Can you use one word to describe how awesome Geomtry dash is?")
    if answer.startswith("epic"):
        print(":)")
        return True
    print(":<")
    return False
开发者ID:lavakiller123,项目名称:python-1,代码行数:7,代码来源:gd.py


示例18: q4

def q4():
    answer =ask(c.magenta + 'what is the average life span of a narwhal in years?')
    if answer == '25-30':
        print('yes')
        return True
    print('no')
    return False
开发者ID:lewington3348,项目名称:python-1,代码行数:7,代码来源:narwhals.py


示例19: _gitflow_release_start

 def _gitflow_release_start(self):
     logger.info('Location: ' + utils.execute_command('pwd'))
     self.vcs.gitflow_check_branch("develop", switch=True)
     cmd = self.vcs.cmd_gitflow_release_start(self.data['new_version'])
     print cmd
     if utils.ask("Run this command"):
         print utils.execute_command(cmd)
开发者ID:virtualsciences,项目名称:egg.releaser,代码行数:7,代码来源:prerelease.py


示例20: q3

def q3():         
    answer = ask("Use one word that would describe the unicorns magical fur?")
    if answer.startswith("smile"):
        print(":)")
        return True
    print(":<")
    return False
开发者ID:billybob25,项目名称:python-1,代码行数:7,代码来源:fluffy.py



注:本文中的utils.ask函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.assert_contains函数代码示例发布时间:2022-05-26
下一篇:
Python utils.argmax函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap