Link to home
Start Free TrialLog in
Avatar of jskfan
jskfanFlag for Cyprus

asked on

Class and method: main() in python

Class and method: main() in python

I have seen examples in python where they use class main() or method main(). I wonder if it has the same meaning as in Java, where the main method gets executed first, or it is just a name that can be different than main() ?

Thank you
ASKER CERTIFIED SOLUTION
Avatar of gelonida
gelonida
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jskfan

ASKER

Ok............ I have seen Main used in Java , which is the starting point of the code compiling I believe.

Python has __init__(self)

I wonder if the word init can be changed , for instance:

__Test__(self)
Avatar of jskfan

ASKER

after reading online,
it says __init__(self) will be executed without calling the function from within the code.

I got this one
Avatar of jskfan

ASKER

Thank you