tags:

views:

1145

answers:

4

I'm working on framework for testing some command line utilities. I want to create some classes to hold the different types of information more easily.

Python is fairly new to me so I'm not sure how you would handle this. Do you keep all your classes in one file with your main script or can you separate them into their own files and use them in your main script.

What is the paradigm for how you create multiple classes and use them in a single script?

Duplicate of How many python classes should I put in one file

+4  A: 

The keyword is using modules.

utku_karatas
I think this would be a good answer if it was clearer that you can put 1 or more classes in a module (read file) and then import the module to access the class.
crackity_jones
A: 

I spread functionality out into separate files as it makes sense, using a modular approach.

Joe Skora
+1  A: 

"What is the paradigm for how you create multiple classes and use them in a single script?"

Are you asking about the import statement?

S.Lott
A: 

An answer from the duplicate question in the comments seems to answer my question. My understanding now is that you can add multiple classes to a separate file which would then be referred to as a module. Then you can import that module to use your classes.

crackity_jones