Python Forum
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Code not working
#2
The problem is that RaceGen has two arguments, 'self' because it is inside of a class, and 'event' to pass the clicked event details.

    def RaceGen(self, event):
        CR = ("Dwarf", "Dragonborn", "Elf", "Gnome", "Half-Elf", "Half-Orc", "Halfing", "Human", "Tiefling")
        print(f"{random.choice(CR)}")
Reply


Messages In This Thread
Code not working - by Luzaich - Sep-03-2018, 03:57 PM
RE: Code not working - by Alfalfa - Sep-03-2018, 04:31 PM
RE: Code not working - by Gribouillis - Sep-03-2018, 04:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Tk .set not working in parts of code User01 2 1,901 Feb-13-2021, 03:39 PM
Last Post: deanhystad
  [Tkinter] my simple window code is not working antonmichel 8 13,183 Jan-29-2018, 06:24 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020