我有一个由以下生成的文件:
摘抄:
group0 = ['ParentPom']
group1 = ['Commons','http', 'availability','ingestPom','abcCommons','solrIndex','123Service']
...
group10=['totalCommons','Generator']
Run Code Online (Sandbox Code Playgroud)
我如何在我的python脚本中包含它,尝试导入但没有运气
>>> import dependencies_custom
>>> print (group2[0])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'group2' is not defined
Run Code Online (Sandbox Code Playgroud)
小智 5
在import您正在使用的表单中,您应该能够访问这些组
dependencies_custom.group2[0]
Run Code Online (Sandbox Code Playgroud)
类型表示法.如果您只想使用group2[0]符号,请尝试使用:
from dependencies_custom import *
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22 次 |
| 最近记录: |