2

What exactly is a Python module? From what I've read, it seems like any Python file can be considered a module.

With that in mind, is it true that python modules are needed if object orientation is to be used in a python program?

asked Apr 5, 2015 at 22:46
5
  • Yes, the two are synonymous. Commented Apr 5, 2015 at 22:47
  • 1
    By object orientation do you mean one class per file? Because those are not synonymous. Commented Apr 5, 2015 at 22:50
  • I think your professor is getting at the fact that you can have multiple classes and such in one module. Commented Apr 5, 2015 at 22:55
  • @keyser So do you think the statement would be false or true? Because a single module can have a class in it, and we can create instances of that without having that class be located in another module. Making his statement false, no? Commented Apr 5, 2015 at 23:30
  • Well, it depends on the interpretation of "modules". A python module will be used, but multiple isn't necessary. Just make sure you understand what a module is and you can't go wrong. Commented Apr 5, 2015 at 23:33

1 Answer 1

2

Your question is very unclear, but every program requires at least one module in order to run code, regardless of whether your code is object oriented or not, though it is typical to create different files for different purposes.

answered Apr 5, 2015 at 22:49
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.