Quotidien Shaarli

Tous les liens d'un jour sur une page.

October 5, 2017

?rLBU0A

!/usr/bin/env python3

import tkinter
import matplotlib.pyplot as plt
import time

liste ={}
header={}
liste[1] = [1,2,3,4]
header[1] = [4,5,7,9]
liste[2] = [1,2,3,4]
header[2] = [40,50,70,90]

def graph(param):

plt.plot(liste[int(param)],header[int(param)],".")
plt.show()

def recup():
graph(scale.get())

main_window = tkinter.Tk()

bouton = tkinter.Button(text='ok',command = recup)
bouton.grid()

bouton2 = tkinter.Button(text='ok',command = lambda x=2:graph(x))
bouton2.grid()

scale = tkinter.Scale(orient='horizontal', from_=1, to=2, width =60)
scale.grid()

main_window.mainloop()