Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Installation
pip install tkchart
Importing
import tkchart
import package
import tkchart
Create Line Chart and place the chart
chart = tkchart.LineChart(
master=root,
x_axis_values=("a", "b", "c", "d", "e", "f"),
y_axis_values=(100, 900)
)
chart.place(x=10, y=10)
Create Line
line = tkchart.Line(master=chart)
Display Data display data using a loop
def loop():
while True:
random_data = random.choice(range(100, 900))
chart.show_data(line=line, data=[random_data])
time.sleep(1)
#call the loop as thead
theading.Thread(target=loop).start()
import tkchart # <- import the package
import tkinter
import random
import threading
import time
#create window
root = tkinter.Tk()
#create chart
chart = tkchart.LineChart(
master=root,
x_axis_values=("a", "b", "c", "d", "e", "f"),
y_axis_values=(100, 900)
)
chart.place(x=10, y=10) #place chrt
#create line
line = tkchart.Line(master=chart)
def loop():
while True:
random_data = random.choice(range(100, 900)) #get random data
chart.show_data(line=line, data=[random_data]) # <- display data using chart
time.sleep(1) #wait 1 sec
#call the loop as thead
threading.Thread(target=loop).start()
root.mainloop()
FAQs
tkchart is a Python library for creating live updating line charts in Tkinter.
We found that tkchart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.