Define Classes in Packages

后端 未结 3 1588
醉酒成梦
醉酒成梦 2021-02-20 02:57

I\'m learning Python and I have been playing around with packages. I wanted to know the best way to define classes in packages. It seems that the only way to define classes in a

3条回答
  •  再見小時候
    2021-02-20 03:31

    This is perfectly doable. Just create a new class module for each of those classes, and create exactly the structure you posted.

    You can also make a Recursion.py module or something similar, and include all 3 classes in that file.

    (I'm also new to Python from Java, and I haven't yet put anything in my __init__.py files...)

提交回复
热议问题