current position:Home>Python will test Put the PY file in a python package (such as D: \ TT), import the package test in test2, and output the value of the variable data.

Python will test Put the PY file in a python package (such as D: \ TT), import the package test in test2, and output the value of the variable data.

2022-02-02 15:38:03 CSDN Q & A

take test.py Put the document in a python In bag ( Such as D:\tt), stay test2 Import package from test, Output variables data Value .
stay D Create folder under disk tt, take test.py Put it in tt In the folder , Create an empty python Program , Name it __init__.py, Save to tt In the folder .
establish test2.py file , Save to D Under the root directory




Refer to the answer 1:

img




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.primo.wiki/2022/02/202202021538001869.html

Random recommended