我想将python脚本导入到另一个脚本中.
$ cat py1.py
test=("hi", "hello")
print test[0]
$ cat py2.py
from py1 import test
print test
Run Code Online (Sandbox Code Playgroud)
如果我执行py2.py:
$ python py2.py
hi
('hi', 'hello')
Run Code Online (Sandbox Code Playgroud)
无论如何我可以静音第一个print来自的from py1 import test?
我不能评论的print的py1,因为它正在使用其他地方.
python ×1