For some reason I'd like to use R to plot a Python output in real time.
Let's imagine a simple case like this one:
# Python
import random
for i in xrange(100):
output = random.gauss(1,1)
# R
output.vector = append(output.vector, output)
plot(output.vector)
How can I transfer the variable output
from Python to R in real time? I think there are two questions (or more) hidden behind this one:
- What is the most efficient way to synchronize the two programs?
- What is the most efficient way to transfer a value from Python to R (write on a text file?)