2

I have a Python program named read.py which reads data from serial communication every second, and another python program called calculate.py which has to take the real time values from read.py.

Using subprocess.popen('read.py',shell=True) I am able to run read.py from calculate.py

May I know how to read or use the value from read.py in calculate.py? Since the value changes every second I am confused how to proceed like, saving value in registers or producer consumer type, etc.

for example : from import datetime when ever strftime %s is used, the second value is given how to use the same technique to use variable from another script?

1
  • 1
    Did you take a look at this and this? Commented Nov 7, 2019 at 11:23

1 Answer 1

1

I can suggest writing values to a .txt file for later reading

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.