python如何在脚本中包含列表文件
我有一个文件,该文件由以下程序生成: 摘录:python如何在脚本中包含列表文件,python,Python,我有一个文件,该文件由以下程序生成: 摘录: group0 = ['ParentPom'] group1 = ['Commons','http', 'availability','ingestPom','abcCommons','solrIndex','123Service'] ... group10=['totalCommons','Generator'] 我怎么能在我的python脚本中包含这个,尝试导入但没有运气 >>> import dependencies_c
group0 = ['ParentPom']
group1 = ['Commons','http', 'availability','ingestPom','abcCommons','solrIndex','123Service']
...
group10=['totalCommons','Generator']
我怎么能在我的python脚本中包含这个,尝试导入但没有运气
>>> import dependencies_custom
>>> print (group2[0])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'group2' is not defined
>>导入依赖项\u自定义
>>>打印(组2[0])
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
NameError:未定义名称“group2”
在您使用的导入
表单中,您应该能够通过
dependencies_custom.group2[0]
类型符号。如果只想使用justgroup2[0]
表示法,请尝试使用:
from dependencies_custom import *
在您使用的
import
表单中,您应该能够通过
dependencies_custom.group2[0]
类型符号。如果只想使用justgroup2[0]
表示法,请尝试使用:
from dependencies_custom import *