Jun-23-2018, 06:45 PM
If your first code is in a file, for example, called mySensorModule.py.
You can import all of its content with:
You can import all of its content with:
import mySensorModule as mS # To call read_sensor() sensorID = 1 mS.read_sensor(sensorID)Or...
from mySensorModule import read_sensor # Call read_sensor() sensorID = 1 read_sensor(sensorID)