I did quite a lot of research both within and outside of stackoverflow. Yes, there are similar topics. But I could not find the answer to my specific problem. Maybe because I can not see the bigger picture yet with my current understanding of Python.
In the last line I get the error "No value for argument 'self' in method call". How would I have to properly call the method here? Or is it not possible at all to call methods within the same class?
class Main:
metronomeState = True
currentMillis = 0
lastMillis = 0
intervalMillis = 0
bpm = 120
measureCount = 0
def bpmToMilliInterval(self):
self.bps = Main.bpm/60
return int((1/self.bps)*1000)
Main.intervalMillis = Main.bpmToMilliInterval()
It might seem that there would be no reason for this class because I do not need to instantiate it. But I want to use the code of Main() in another class Gui() which is responsible for all the GUI stuff. So the different classes are a way for me to organize the code. Good approach or not?
Thanks in advance for your help!
Thanks for all of your comments! I figured something out that works. I hope it makes sense, too. And I fixed my indentations.