Advertisement
davidgaf

retrieve

Dec 4th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1.  
  2. import pandas as pd
  3. tc = 382
  4. num_intera = 0
  5. offset = 100
  6. rest = tc % offset
  7.  
  8. if (rest>0):
  9.     num_intera = (tc // offset) + 1
  10.     print(num_intera)
  11. else:
  12.     print(tc // offset)
  13.  
  14. # Operador Ternário - Python função
  15.  
  16. def verificaDivisoes(rest=0, offset=100, tc=0):
  17.     rest = tc % offset
  18.     return (tc // offset)+1 if rest > 0 else tc // offset  
  19.  
  20. print(verificaDivisoes(tc=tc))
  21.  
  22. for i in range(1, verificaDivisoes(tc=tc)+1):
  23.     print(offset*i)
  24.  
  25. obj = {
  26.     "id": 2727,
  27.     "titulo" : "1.1.1 - Política de Celeridade Processual",
  28.     "tipo": "Etapa",
  29.     "situacao": "Em andamento",
  30.     "perc_concluido": 75,
  31.     "data_inicio": "2019-11-25",
  32.     "data_fim": "2019-12-31",
  33.     "macrodesafio": "Celeridade na Prestação Jurisdicional"
  34. }
  35.  
  36. df = pd.DataFrame([obj])
  37.  
  38. df = df.append(obj, ignore_index=True)
  39. print(df)
  40. print(f'Shape: {df.shape}')
  41. print(df.describe())
  42.  
  43. from tkinter import *
  44. root = Tk()
  45. height = df.shape[0]
  46. width = df.shape[1]
  47. for i in range(height): #Rows
  48.     for j in range(width): #Columns
  49.         print(i,j)
  50.         b = Entry(root, text="", bg="white", fg="black")
  51.         b.insert(END,df.iat[i,j])
  52.         b.grid(row=i, column=j)
  53.  
  54. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement