def random_hero(self):
hero_dict = ["Adagio", "Alpha", "Ardan", "Baron", "Blackfeather", "Catherine", "Celeste", "Flicker", \
"Fortress", "Glaive", "Gwen", "Idris", "Joule", "Kestrel", "Koshka", "Krul", "Lance", "Lyra", "Ozo", "Petal", \
"Phinn", "Reim", "Ringo", "Rona", "Samuel", "Saw", "Skaarf", "Skye", "Taka", "Vox"]
num = 1
newRandomHero = random.sample(hero_dict,num)
global randHeroName
randHeroName = newRandomHero[0]
print (randHeroName)
heroName = randHeroName
def tab3UI(self):
self.setGeometry(250, 100, 800, 300)
hero_dict = ["Adagio", "Alpha", "Ardan", "Baron", "Blackfeather", "Catherine", "Celeste", "Flicker", \
"Fortress", "Glaive", "Gwen", "Idris", "Joule", "Kestrel", "Koshka", "Krul", "Lance", "Lyra", "Ozo", "Petal", \
"Phinn", "Reim", "Ringo", "Rona", "Samuel", "Saw", "Skaarf", "Skye", "Taka", "Vox"]
num = 1
randomHero = random.sample(hero_dict,num)
layout.
addWidget(QLabel("Hero:"),
0,
0) global heroName
heroName
= layout.
addWidget(QLabel(randHeroName
),
0,
1)
layout.addWidget(self.btnRandomHero,0,3)
self.btnRandomHero.clicked.connect(self.random_hero)
blankSpaceLabel1
= layout.
addWidget(QLabel(""),
0,
4,
0,
8) blankSpaceLabel1
= layout.
addWidget(QLabel(""),
1,
0,
0,
8)
self.setTabText(2,"Ultimate Bravery")
self.tab3.setLayout(layout)
def random_hero(self):
hero_dict = ["Adagio", "Alpha", "Ardan", "Baron", "Blackfeather", "Catherine", "Celeste", "Flicker", \
"Fortress", "Glaive", "Gwen", "Idris", "Joule", "Kestrel", "Koshka", "Krul", "Lance", "Lyra", "Ozo", "Petal", \
"Phinn", "Reim", "Ringo", "Rona", "Samuel", "Saw", "Skaarf", "Skye", "Taka", "Vox"]
num = 1
newRandomHero = random.sample(hero_dict,num)
global randHeroName
randHeroName = newRandomHero[0]
print (randHeroName)
heroName = randHeroName
def tab3UI(self):
self.setGeometry(250, 100, 800, 300)
layout = QGridLayout()
hero_dict = ["Adagio", "Alpha", "Ardan", "Baron", "Blackfeather", "Catherine", "Celeste", "Flicker", \
"Fortress", "Glaive", "Gwen", "Idris", "Joule", "Kestrel", "Koshka", "Krul", "Lance", "Lyra", "Ozo", "Petal", \
"Phinn", "Reim", "Ringo", "Rona", "Samuel", "Saw", "Skaarf", "Skye", "Taka", "Vox"]
num = 1
randomHero = random.sample(hero_dict,num)
layout.addWidget(QLabel("Hero:"),0,0)
global heroName
heroName = layout.addWidget(QLabel(randHeroName),0,1)
self.btnRandomHero = QPushButton("Random")
layout.addWidget(self.btnRandomHero,0,3)
self.btnRandomHero.clicked.connect(self.random_hero)
blankSpaceLabel1 = layout.addWidget(QLabel(""),0,4,0,8)
blankSpaceLabel1 = layout.addWidget(QLabel(""),1,0,0,8)
self.setTabText(2,"Ultimate Bravery")
self.tab3.setLayout(layout)
To copy to clipboard, switch view to plain text mode
Bookmarks