I am very new to programming. This may be a stupid question but here it is. Where do I put the colours.png file? Is there a a default location for the source? How does the widget know where to look for the source? How would I define where to load a file/image from? I have been able to follow along through all tutorials until this one. Please help. Thanks
Hi, actually i needed to cast my width_per_child to an Integer for the range thing. Not sure if that is Python specific (i am on 3.3), environment specific (Win7+PyCharm), or if you just have a screent resulution % 6 . Maybe that will help out others. Anyways, thanks for the good work
really struggling with understanding what some of this means from lack of base knowledge such as 'self' and '_innit_' etc. but how tould i add buttons onto my background??
well if you define a function in a class it always uses the self attribute, as the class is called from an "instance" the instance bascilly becomes "self" example: class Human: eyes = 2 stephanie = Human() #stephanie is the instance here now you could do print("stephanie.eyes") further more, functions are only execute when called, except the __init__ function, it is called upon creating an instance class Human: __init___(self, name): self.name = name steph = Human("Stephanie") # creates an instance that calls the init functions the "self" basiclly becomes steph for this instance so you can call steph.name Just in case you still dont know , maybe others wondered the same and find this helpful :)
width_per_child = width / number_of_children This is giving me a division by Zero Error (maybe because the children don't exist yet?) Tried Kyalo's solution below but that isn't it.