Example #1
0
    def my_four_play(self):
        for team1, team2 in self.four_list:
            if self.my_team in [team1, team2]:
                record = input("请输入{}vs{}的比分[示例3-1]:".
                               format(team1.name, team2.name))
                record = record.replace(":", "-").replace(":", "-").split("-")

                error_flag = 1
                while error_flag:
                    try:
                        a, b = int(record[0]), int(record[1])
                        assert 0 <= a <= 13
                        assert a != b
                        assert 0 <= b <= 13
                        error_flag = 0
                    except ValueError:
                        record = input("请输入{}vs{}的比分[示例3-1]:".
                                       format(team1.name, team2.name))
                        record = record.replace(":", "-").replace(":", "-").split("-")
                    except AssertionError:
                        record = input("请输入{}vs{}的比分[示例3-1]:".
                                       format(team1.name, team2.name))
                        record = record.replace(":", "-").replace(":", "-").split("-")
                    except IndexError:
                        record = input("请输入{}vs{}的比分[示例3-1]:".
                                       format(team1.name, team2.name))
                        record = record.replace(":", "-").replace(":", "-").split("-")

                if record[0] > record[1]:
                    self.two_list.append(team1)
                elif record[0] == record[1]:
                    print("错误")
                else:
                    self.two_list.append(team2)
                print("  {}vs{} : {}-{}".format(team1.name, team2.name, record[0], record[1]))

            else:
                self.count += 1
                record = play(team1, team2, self.count, False)
                record = record.split("-")
                while record[0] == record[1]:
                    self.count += 1
                    record = play(team1, team2, self.count, False)
                    record = record.split("-")

                if record[0] > record[1]:
                    self.two_list.append(team1)
                else:
                    self.two_list.append(team2)
                print("  {}vs{} : {}-{}".format(team1.name, team2.name, record[0], record[1]))
        print("{} 晋级决赛!".format(",".join([x.name for x in self.two_list])))
Example #2
0
from autoplay import play

play()
Example #3
0
from autoplay import play

f=open("links.txt","r")

g = open("newlinks.txt","r")
numLinks = len(f.readlines()) + len(g.readlines())
                                    
print("num vids: ",numLinks)
n = input("how many vids do u want to play: ")
l = input("how many times do you want to loop: ")

vids=[]
print("enter vid numbers")
for i in range(int(n)):
  s= "vid "+str(i)+": " 
  vid = input(s)
  vids.append(vid)

for i in range(int(l)):
  [play(v) for v in vids]