Hello Everyone.
I am trying to build a streamlit application that can 2 plot live data but in the process i am getting the above mentioned error.
palceholder = st.empty()
with palceholder.container():
while True:
with open('data.txt','a') as f:
f.write(str(random.randint(1+i,10+i)) + ',' + str(random.randint(1+i,10+i)) + '\n')
with open("data.txt") as f:
data = f.readlines()[-1]
print(data)
a,b = data.split(',')
a = int(a)
b = int(b)
x.append(a)
y.append(b)
x2.append(a + 2)
y2.append(b + 2)
i += 1
if x_max<a:
x_max = a
if y_max<b:
y_max = b
fig, ax = plt.subplots()
ax.plot(x,y)
st.pyplot(fig)
fig2, ax2 = plt.subplots()
ax2.plot(x2,y2)
st.pyplot(fig2)
time.sleep(0.1)
palceholder.empty()
This error message pops up as soon as i open the application in the browser window.
I am unable to solve this issue. Please help me solve the issue…
Thank you for reading my request.