4
Python 3.3以降のパッケージでは__init__.pyは必要ありませんか
私はPython 3.5.1を使用しています。私はここでドキュメントとパッケージセクションを読みました:https : //docs.python.org/3/tutorial/modules.html#packages 今、私は次の構造を持っています: /home/wujek/Playground/a/b/module.py module.py: class Foo: def __init__(self): print('initializing Foo') 今、中に/home/wujek/Playground: ~/Playground $ python3 >>> import a.b.module >>> a.b.module.Foo() initializing Foo <a.b.module.Foo object at 0x100a8f0b8> 同様に、今は家にありPlaygroundます: ~ $ PYTHONPATH=Playground python3 >>> import a.b.module >>> a.b.module.Foo() initializing Foo <a.b.module.Foo object at 0x10a5fee10> 実際、私はあらゆることを行うことができます: ~ $ PYTHONPATH=Playground python3 >>> …
193
python
python-3.x
package