+ 1

How to code a class (objects) in python, it needs 2 separate files

Guys I need your help , I wanna Code a Class in python but the problem is , as you know We need 2 separate files to code it right? But we only Have one file here ! How can I code it ??

17th Apr 2022, 8:36 AM
Angelin
Angelin - avatar
2 ответов
17th Apr 2022, 8:55 AM
Slick
Slick - avatar
+ 2
You can define your classes in your main file. When you have a lot of them, or when they are big, or you want to use them in multiple programs it makes sense to put them into a separate file. But that's not a necessity.
17th Apr 2022, 10:21 AM
Simon Sauter
Simon Sauter - avatar