When I am used to writing java code, I will try to define package when I write Python code. However, when I introduce it, I report an error: typeerror: ‘module’ object is not called
Why
For example, I create the person. Py source file in the package, and then create the student class in this file
How to import the student class
Habitual thinking, from clazz. Student is OK, but it is not
The correct way is from clazz.person import student or from clazz.person import*
That is to say, which classes are imported from which py file under which package
Similar Posts:
- [design and development] Python learning notes – Super () argument 1 must be type, not classobj
- Python: __ new__ Method and the processing of typeerror: object() takes no parameters
- [Solved] org.hibernate.MappingException: Unknown entity: com.huangliusong.entity.Person
- How to Solve Python TypeError: ‘list’ object is not callable
- [Solved] Cannot resolve symbol ‘SpringJUnit4ClassRunner’
- The hierarchy of the type is inconsistent problem solving
- [How to Solve]error: invalid array assignment
- [Solved] Error occurred during initialization of boot layer
- TypeError: ‘module’ object is not callable
- Springmvc Error: HTTP Status 500 – Could not write content: No serializer