liujuanjuan1984 / ucanuupnobb

you can you up, no bb. 自学 python 编程过程中的挑战、笔记及我的践友们。
17 stars 9 forks source link

__init__.py 模块有啥用 #77

Open liujuanjuan1984 opened 4 years ago

liujuanjuan1984 commented 4 years ago

How do you create a package so that the following reference will work?

p = mytools.myparser.MyParser() Declare the myparser package in mytools.py Create an init.py in the home dir Inside the mytools dir create a init.py and myparser.py Create a myparser.py directory inside the mytools directory This can not be done