문제

I have noticed, in python, that the path to a script can take 2 forms

filename.py

or

filename/__init__.py

What is the reason for this?

도움이 되었습니까?

해결책

simply, if you have a large filename.py containing many classes. you want to split them into separate files, and keep them under the same namespace. you can use the 2nd method.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top