Advertisement
Astranome

SQLiteTkTablo

Jun 15th, 2020
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.02 KB | None | 0 0
  1. # импорт всего модуля
  2.  
  3. from tkinter import *
  4. from tkinter.ttk import *
  5. import json
  6. import time
  7. import sqlite3
  8. # создание окна tkinter
  9.  
  10. root = Tk()
  11.  
  12. root.title('BTC USDT Binance')
  13. root.geometry("500x500")
  14. root.config(bg="purple")
  15.  
  16. def tablo():
  17.  
  18.     conn = sqlite3.connect("tplong.db")
  19.     cursor = conn.cursor()
  20.     cursor.execute('SELECT * FROM albums ')
  21.  
  22.     raw = cursor.fetchall()
  23.     pr=raw [0]
  24.     print(pr)
  25.  
  26.     bid=(pr [0])
  27.     bid=float(bid)
  28.     bid=str(bid)
  29.     startrate=float(pr [1])
  30.     startrate=str(startrate)
  31.     appl=str(pr [2])
  32.     sl=str(pr [3])
  33.     strat=(pr [4])
  34.     am=str(pr [5])
  35.     perc=str(pr [6])
  36.    
  37.     lbl.config(text = 'APPLY  ' + appl)
  38.     lbl1.config(text = 'BID  ' + bid)
  39.     lbl2.config(text = 'AMOUNT ' + am)
  40.     lbl3.config(text = 'StopLoss ' + sl)
  41.     lbl4.config(text = 'Strategy  '+strat)
  42.     lbl5.config(text = 'PERC ' + perc)
  43.     lbl6.config(text = 'Startrate ' + startrate)
  44.    
  45.     lbl.after(1000, tablo)
  46.  
  47. lbl = Label(root, font = ('calibri', 20, 'bold'),
  48.             background = 'purple',
  49.             foreground = 'white')
  50. lbl.place(relx=.25, rely=.01)                        
  51. lbl1 = Label(root, font = ('calibri', 20, 'bold'),
  52.             background = 'purple',
  53.             foreground = 'white')
  54. lbl1.place(relx=.25, rely=.1)
  55. lbl2 = Label(root, font = ('calibri', 20, 'bold'),
  56.             background = 'purple',
  57.             foreground = 'white')
  58. lbl2.place(relx=.25, rely=.2)
  59. lbl3 = Label(root, font = ('calibri', 20, 'bold'),
  60.             background = 'purple',
  61.             foreground = 'white')
  62. lbl3.place(relx=.25, rely=.3)
  63. lbl4 = Label(root, font = ('calibri', 20, 'bold'),
  64.             background = 'purple',
  65.             foreground = 'white')
  66. lbl4.place(relx=.25, rely=.4)
  67. lbl5 = Label(root, font = ('calibri', 20, 'bold'),
  68.             background = 'purple',
  69.             foreground = 'white')
  70. lbl5.place(relx=.25, rely=.5)
  71. lbl6 = Label(root, font = ('calibri', 20, 'bold'),
  72.             background = 'purple',
  73.             foreground = 'white')
  74. lbl6.place(relx=.25, rely=.6)
  75.  
  76. tablo()
  77. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement