有包 testcli, testcli 中有文件 b.py等 ,如何把这个文件导出或者说复制出来?
具体场景是通过
entry_points={ 'console_scripts':[ 'testcli= testcli.cli:main' ]
设定命令行工具入口,现在进入了 testcli.cli:main 函数,在这个 main 函数中,怎么写才能把包 a 中的所有文件导出来呢?
![]() | 1 xiaket 2016-06-02 20:28:38 +08:00 你试试 from testcli import a 后 print dir(a)看下? |
![]() | 2 NxnXgpuPSfsIT 2016-06-03 08:58:58 +08:00 |
3 Pythagodzilla 2016-06-03 11:11:47 +08:00 import module print module.__file__ |