for an example of this see the small tutorial on interfacing with Python I've written Two ways communication between Python3 and Arduino
for an example of this see the small tutorial on interfacing with Python I've written Two ways communication between Python3 and Arduino