test_from_import.py
print ('i am test from import',__name__)
from from_import import *
m = title
print ('test from import',m)
title ='hhh'
print ('test from import',title)
from_import.py
print ('i am a test about from import ',__name__)
title = 'hhahh'
# def output():
# print ('i am output ()')
import test_from_import
print ('from_import',title)
在交互模式下运行
test_from_import.py结果如下: