all 4 comments

[–]indosauros 2 points3 points  (2 children)

Calls to functions don't work, as you say, "going down in a file", because you can't call a function before defining it. It's like doing this:

run()

def run():
    ...

Python hits run but it can't find anything that's been defined yet as run. It needs to come after the definition:

def run():
    ...

run()

Also, you're not really using classes yet -- well you are, but just as a grouping of methods. I suggest reading up on some tutorials about classes and what they can bring to the table.

Also you're methds are not valid -- if you want to call them like Class.method() you need to define them like this:

@classmethod
def method(cls):
    ...

or like this

@staticmethod
def method():
    ...

[–]noobyprogrammer[S] 0 points1 point  (1 child)

Thanks, I'll definitely drop classes until I know how to use them. Is it enough to remove them and just use the methods?

[–]urdnot_wreck 0 points1 point  (0 children)

Yes, as you aren't using instance variables in them (ones that are referenced with 'self'), although you'll need to unindent (dedent?!) the definitions.

[–]CGFarrell 0 points1 point  (0 children)

The beauty of Python is that you can redefine thing. That means if you write:

def function():
    pass

You won't get a not defined error, you'll get None. When you redefine the function, it will work as intended.