当前位置: 首页>>代码示例>>Python>>正文


Python Configuration.modify_value_in_xml方法代码示例

本文整理汇总了Python中configuration.Configuration.modify_value_in_xml方法的典型用法代码示例。如果您正苦于以下问题:Python Configuration.modify_value_in_xml方法的具体用法?Python Configuration.modify_value_in_xml怎么用?Python Configuration.modify_value_in_xml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在configuration.Configuration的用法示例。


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

示例1: __init__

# 需要导入模块: from configuration import Configuration [as 别名]
# 或者: from configuration.Configuration import modify_value_in_xml [as 别名]

#.........这里部分代码省略.........
                print "you press key %s" %(read_key)
            elif read_key == "h":
                print "You press key %s" % read_key
            elif read_key == "b":
                break
            else:
                read_key = raw_input("choose another option.")

            read_key = self.start_end_menus("save")

    def print_sub_menu_options(self):
        read_key = self.start_end_menus("options")

        while read_key != "B":
            if read_key == "a":
                self.print_sub_menu_algorithm()
            elif read_key == "d":
                self.print_sub_menu_difficulty()
            elif read_key == "v":
                self.print_sub_menu_solved_out_put()
            elif read_key == "b":
                break
            else:
                read_key = raw_input("choose another option.")

            read_key = self.start_end_menus("options")

    def print_sub_menu_algorithm(self):
        read_key = self.start_end_menus("algorithm")

        while read_key != "B":
            if read_key == "k":
                self.algorithm = "backtracking"
                self.new_configuration.modify_value_in_xml(self.algorithm,"algorithm")
                raw_input ("you chose " +self.algorithm + " Algorithm")
                break
            elif read_key == "n":
                self.algorithm = "peternorvig"
                self.new_configuration.modify_value_in_xml(self.algorithm,"algorithm")
                raw_input ("you chose " + "Peter Norvig" + " Algorithm")
                break
            elif read_key == "i":
                self.algorithm = "recursive"
                self.new_configuration.modify_value_in_xml(self.algorithm,"algorithm")
                raw_input ("you chose " +self.algorithm + " Algorithm")
                break
            elif read_key == "b":
                break
            else:
                read_key = raw_input("choose another option.")

            read_key = self.start_end_menus("algorithm")

    def print_sub_menu_difficulty(self):
        read_key = self.start_end_menus("difficulty")
        difficulty_matrix = self.new_menus.get_difficulty_matrix()

        while read_key != "B":
            if read_key == "e":
                self.print_sub_menu_edit()
            try:
                if read_key == "e":
                    self.print_sub_menu_edit()
                elif read_key == "0":
                    self.difficulty = difficulty_matrix[0][1]
                    self.new_configuration.modify_value_in_xml(self.difficulty,"difficulty")
开发者ID:RafaelAlfaro,项目名称:sudokuC,代码行数:70,代码来源:console_presentation.py


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