Jump to content

Embrisk

Members
  • Posts

    246
  • Joined

  • Last visited

Everything posted by Embrisk

  1. Yeah, I've tried StackOverflow. Nobody knows what's wrong.
  2. So, um, I may or may not have a python programming assignment due tomorrow. I was wondering if anyone could help me work out this code. (Please) It comes up with a name error and says that 'self' hasn't been defined. Anyone know why? (please help.....please) import tkinter import tkinter.messagebox import random import json class programGUI: def __init__(self): self.main=tkinter.Tk() self.main.title('Fruit Test') try: j=open('data.txt', 'r') self.data=json.load(j) j.close() except: tkinter.messagebox.showerror('File Error') self.main.destroy() return fib=0 for i in self.data: fib=fib+1 if fib<2: tkinter.messagebox.showerror('Not enough fruit') self.main.destroy() return self.Tbutton=tkinter.Button(text='True', command=lambda: checkAnswer(answer=True)) self.Fbutton=tkinter.Button(text='False', command=lambda: checkAnswer(answer=False)) self.Tbutton.pack(side='left') self.Fbutton.pack(side='right') def showQuestion(self): fruits=random.sample(self.data, 2) fruit0=fruits[0]['name'] fruit1=fruits[1]['name'] self.components=['calories', 'fibre', 'sugar', 'vitamin_c'] nutrition=random.choice(self.components) fruitNutr0=fruits[0][nutrition] fruitNutr1=fruits[1][nutrition] if nutrition=='vitamin_c': nutrition='vitamin c' measurement='milligrams' else: measurement='grams' moreLess=random.choice(['more', 'less']) self.mainMessage=tkinter.Label(self.main, text='100 '+str(measurement)+' of '+str(fruit0)+' contains '+moreLess+' '+str(nutrition)+' than a 100 '+str(measurement)+' of '+str(fruit1)) self.mainMessage.pack() def checkAnswer(answer=None): checkAnswer(showQuestion) if (answer==True and moreLess=='more' and fruitNutr0>fruitNutr1) or (answer==True and moreLess=='less' and fruitNutr0<fruitNutr1) or (answer==False and moreLess=='less' and fruitNutr0>fruitNutr1) or (answer==False and moreLess=='more' and fruitNutr0<fruitNutr1): tkinter.messagebox.showinfo('Correct!') else: tkinter.messagebox.showerror('Incorrect!') self=programGUI() showQuestion(self) self.showQuestion() <This is where it says I have a problem. tkinter.mainloop() gui=programGUI() Edit: The file I'm loading is a list containing dictionaries of fruit and nutritional information, eg: [{'name':'lemon', 'calories':'43', 'fibre':'75'...}{'name':'apple', 'calories':'89'....}]
  3. What would happen to a broken shardblade? It takes eleven seconds to summon?
  4. To me, Harry Potter scores 9.7/10 Non-cosmere about 9.2/10 cosmere about 6.8/10 Most important to least important: Engaging Characters doing what the established character would do in that situation Humour consistency (consistent magic, too) Certain story points all adding up perfectly. Yeah, Harry Potter has some odd stuff. Why are a few first year students able to get past obstacles designed by teachers? Why is moaning mertyl not questioned about the basalisk? Why is Harry Potter protected by plot armour? BUT it is engaging, with characters that feel real, and is full of humour. The magic might not follow strict rules, but it's fairly consistent, eg: magic tends to wear off depending on how well the spell was performed. That's why I like it so much. I like his non-cosmere works next. And then cosmere works last, (unpopular opinion,) because the plot seems to be dragging the characters around all the time to save the world from imminent doom, especially Shallan. Stormlight series is my favourite cosmere work, though.
  5. I've said this in another unpopular opinion section, but.. I prefer Harry Potter.
  6. It mentions that once you start compounding, it becomes dangerous to stop. That's just one thing I noticed.
  7. 1. Kaladin dressed as Dobby the house elf because it amuses the lighteyes. 2. Alcatraz realised he was in the wrong series. 3. I draw a chalk time machine for my chalking. He grabs chalk technology from the future. 4. Brandon Sanderson has nightmares about not including enough foreshadowing.
  8. I play a fast white deck with a little green. My reasoning? 74% of people think that blue is the strongest colour. The best defence against a control deck is a speed deck, usually white or green. Yay for MTG.
  9. Maybe it's because there are people in other countries who like Brandon Sanderson... Just maybe, though. ^^ A "h" sound and an "o" sound are different. In English, people pronounce it "onner” because we don't pronounce the "h." People actually pronounce it in Rosharian, according to Shallan.
  10. Is the alchemy in full metal alchemist a hard or soft magic system?
  11. Someone said: "introducing scorbunny and two literal pieces of trash."
  12. I got bored of anime. Except for the girl who leapt through time, everything I watch is inconsistent and full of boring plots, boring characters, or both.
  13. Maybe she IS just an emotionless slab of granite. Just kidding, I don't know.
  14. I think the only reason odium kills would be so he can inflict more pain.
  15. I think a nicrosil spike might have done it. Maybe not.
  16. On the other hand, consistency is important. He can't play favourites with main characters. So either he creates characters who aren't disabled, or he creates characters who heal through stormlight. (Or characters who see themselves as disabled. Like Toph. Characters like Toph.)
  17. I just don't want Vinn to look like she's never had a hard day in her life. Sometimes they try to cast someone too attractive for a role.
  18. Oh, I definitely agree. He's just doing his best, and I was Soooo happy when he killed Sadeas. I never expected it, because I expected Sadeas to just get away with whatever he wants.
  19. Fortuity Classic Chicago hoodlum. He wanted respect as a teenager. Before becoming an epic, he moved out of home early, and got into a fair number of fights. His yearning to win street fights is why he has increased dexterity, and can detect and avoid things that are going to kill him in a few seconds. His weakness is actually sex, because as a teenager, he got a girl pregnant.
  20. Wow, some really good questions.
  21. My favourite concept album of all time is Alchemy, by dire straits. Alchemy is just their greatest hits, except they changed them, and made them all even more amazing. They were already insanely popular before the album was released, but after, their fan base went insane. Alchemy also includes my favourite version (of the versions they played) of the coolest song ever, the sultans of swing. Romeo and Juliet is another favourite of mine in that album. Edit: I'm not sure this actually counts. Meh.
  22. So, I don't know if they have one here or not, but I decided to make space for people to put custom MTG card designs. Does anyone on here even do the whole "design your own magic the gathering card " thing? The main reason I wanted to create this page was because the create your own magic card thingie seems to wipe the cards monthly. A few cat ones I made. The whole "clowder cost" thing is the spells cost, plus the cost of the number and colour of coloured mana the spell requires.
  23. Actually, now that I've read stormlight, I think Mr Gold could do ruin or odium.
×
×
  • Create New...