Advertisement
ALEXANDAR_GEORGIEV

verticaly_text2

Jul 31st, 2022
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.76 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root=Tk()
  4. root.geometry('800x400+400+200')
  5. # root.configure(bg='green')
  6.  
  7. f1 = Frame(root, bg='red')
  8.  
  9. f1.grid(row=0, column=0, padx=(20,20), pady=(20,0))
  10.  
  11.  
  12. #
  13. # f1.grid_columnconfigure(0, weight=10)
  14. # f1.grid_columnconfigure(1, weight=1)
  15. # f1.grid_columnconfigure(2, weight=1)
  16. # f1.grid_columnconfigure(3, weight=1)
  17. # f1.grid_columnconfigure(4, weight=1)
  18. # f1.grid_columnconfigure(5, weight=1)
  19. # f1.grid_columnconfigure(6, weight=1)
  20. # f1.grid_columnconfigure(7, weight=1)
  21. # Use somewidget.winfo_width() and somewidget.winfo_height() to get the actual widget size, the somewidget['width']
  22.  
  23. can0 = Canvas(f1, height=207, background='lightgrey', highlightthickness=0)  # SystemButtonFace
  24. str0 = can0.create_text(189,103, text='ПОКАЗАТЕЛИ', anchor='center', font='Times, 10', justify='center')
  25. # can0.configure(bg='red')
  26. can0.grid(row=0, column=0, sticky='nsew', rowspan=2)    # n, ne, e, se, s, sw, w, nw, or center
  27.  
  28. # can1 = Canvas(f1, height=25, width=350, background='SystemButtonFace', highlightthickness=0)
  29. # str1 = can1.create_text(180,12.5, text='Отчетна стойност на нетекущите активи', anchor='center', font='Times, 10', justify='center')
  30. # can1.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  31.  
  32. l = Label(f1, text='Отчетна стойност на нетекущите активи', justify='center', height=2, bg='lightblue')
  33. l.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew')
  34.  
  35. # t = Text(f1, height=2, bg='lightblue', width=30)
  36. # t.insert('1.0', 'Отчетна стойност на нетекущите активи')
  37. # t.tag_configure('tag1', justify='center')
  38. # t.grid(row=0, column=1, padx=(0, 0), pady=(0, 0), columnspan=7, sticky='nsew')
  39. # t.tag_add('tag1', '1.0', END)
  40. # #--------------------------------------------------------------------------------------------------------------
  41.  
  42. can2 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
  43. str2 = can2.create_text(25,72, text='В началото на\nпериода', angle=90, anchor='e', font='Times, 10', justify='left')
  44. can2.grid(row=1, column=1, padx=(0,0), sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  45.  
  46. can3 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
  47. str3 = can3.create_text(25,72, text='На постъпилите\nпрез периода', angle=90, anchor='e', fill=None, font='Times, 10')
  48. can3.grid(row=1, column=2, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  49.  
  50. can4 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
  51. str4 = can4.create_text(4,85, text='На излезлите\nпрез периода', angle=90, anchor='n', fill=None, font='Times, 10')
  52. can4.grid(row=1, column=3, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  53.  
  54. can5 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
  55. str5 = can5.create_text(4,90, text='В края на\nпериода (1+2-3)', angle=90, anchor='n', fill=None, font='Times, 10')
  56. can5.grid(row=1, column=4, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  57.  
  58. can6 = Canvas(f1, height=180, width=50, background='grey', highlightthickness=0)
  59. str6 = can6.create_text(4,100, text='Последваща оценка\nв увеличение', angle=90, anchor='n', fill=None, font='Times, 10')
  60. can6.grid(row=1, column=5, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  61.  
  62. can7 = Canvas(f1, height=180, width=50, background='green', highlightthickness=0)
  63. str7 = can7.create_text(4,100, text='Последваща оценка\nв намаление', angle=90, anchor='n', fill=None, font='Times, 10')
  64. can7.grid(row=1, column=6, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  65.  
  66. can8 = Canvas(f1, height=180, width=50, background='white', highlightthickness=0)
  67. str8 = can8.create_text(4,110, text='Преоценена стойност\n(4+5-6)', angle=90, anchor='n', fill=None, font='Times, 10')
  68. can8.grid(row=1, column=7, sticky='nsew')    # n, ne, e, se, s, sw, w, nw, or center
  69.  
  70. w = int(f1['width'])
  71. print(w)
  72. f2 = Frame(root, bg='red', width=378, height=20)
  73. f2.grid(row=1, column=0, padx=(20,20), pady=(0,0), sticky='nsew')
  74.  
  75. lab0 = Label(f2, text='I. Нематериални активи', font=("Times", 7, 'bold'), justify='left', bg='SystemButtonFace', height=1, width=120, anchor='w') # 62
  76. lab0.grid(row=0, column=0, padx=(0, 0), sticky='nsew', columnspan=8)
  77.  
  78. lab1 = Label(f2, text='  1. Продукти от развойна дейност', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
  79. lab1.grid(row=1, column=0, padx=(0, 0), sticky='nsew')
  80.  
  81. lab01 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
  82. lab01.grid(row=1, column=1, padx=(3, 0), sticky='ew')
  83.  
  84. lab02 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
  85. lab02.grid(row=1, column=2, padx=(3, 0), sticky='ew')
  86.  
  87. lab03 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
  88. lab03.grid(row=1, column=3, padx=(3, 0), sticky='ew')
  89.  
  90. lab04 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  91. lab04.grid(row=1, column=4, padx=(3, 0), sticky='ew')
  92.  
  93. lab05 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  94. lab05.grid(row=1, column=5, padx=(3, 0), sticky='ew')
  95.  
  96. lab06 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  97. lab06.grid(row=1, column=6, padx=(3, 0), sticky='ew')
  98.  
  99. lab07 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
  100. lab07.grid(row=1, column=7, padx=(3, 0), sticky='ew')
  101. # --------------------------------------------
  102. lab11 = Label(f2, text='  2. Концесии, патенти, търговски марки, програмни продукти\n  и други подобни права и активи', font="Timesbg, 7", justify='left', bg='white', height=2, width=62, anchor='w')
  103. lab11.grid(row=2, column=0, padx=(0, 0), sticky='nsew')
  104.  
  105. lab012 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2, anchor='e')
  106. lab012.grid(row=2, column=1, padx=(3, 0), sticky='ew')
  107.  
  108. lab13 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=2)
  109. lab13.grid(row=2, column=2, padx=(3, 0), sticky='ew')
  110.  
  111. lab14 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2)
  112. lab14.grid(row=2, column=3, padx=(3, 0), sticky='ew')
  113.  
  114. lab15 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  115. lab15.grid(row=2, column=4, padx=(3, 0), sticky='ew')
  116.  
  117. lab16 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  118. lab16.grid(row=2, column=5, padx=(3, 0), sticky='ew')
  119.  
  120. lab17 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  121. lab17.grid(row=2, column=6, padx=(3, 0), sticky='ew')
  122.  
  123. lab18 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2, anchor='center')
  124. lab18.grid(row=2, column=7, padx=(3, 0), sticky='ew')
  125. # --------------------------------------------
  126. lab21 = Label(f2, text='  3. Търговска репутация', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
  127. lab21.grid(row=3, column=0, padx=(0, 0), sticky='nsew')
  128.  
  129. lab22 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
  130. lab22.grid(row=3, column=1, padx=(3, 0), sticky='ew')
  131.  
  132. lab33 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
  133. lab33.grid(row=3, column=2, padx=(3, 0), sticky='ew')
  134.  
  135. lab44 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
  136. lab44.grid(row=3, column=3, padx=(3, 0), sticky='ew')
  137.  
  138. lab55 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  139. lab55.grid(row=3, column=4, padx=(3, 0), sticky='ew')
  140.  
  141. lab56 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  142. lab56.grid(row=3, column=5, padx=(3, 0), sticky='ew')
  143.  
  144. lab57 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  145. lab57.grid(row=3, column=6, padx=(3, 0), sticky='ew')
  146.  
  147. lab58 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
  148. lab58.grid(row=3, column=7, padx=(3, 0), sticky='ew')
  149. # --------------------------------------------
  150. lab61 = Label(f2, text='  4. Предоставени аванси и нематериални активи\n  в процес на изграждане', font="Timesbg, 7", justify='left', bg='white', height=2, width=62, anchor='w')
  151. lab61.grid(row=4, column=0, padx=(0, 0), sticky='nsew')
  152.  
  153. lab62 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2, anchor='e')
  154. lab62.grid(row=4, column=1, padx=(3, 0), sticky='ew')
  155.  
  156. lab63 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=2)
  157. lab63.grid(row=4, column=2, padx=(3, 0), sticky='ew')
  158.  
  159. lab64 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=2)
  160. lab64.grid(row=4, column=3, padx=(3, 0), sticky='ew')
  161.  
  162. lab65 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  163. lab65.grid(row=4, column=4, padx=(3, 0), sticky='ew')
  164.  
  165. lab66 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  166. lab66.grid(row=4, column=5, padx=(3, 0), sticky='ew')
  167.  
  168. lab67 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2)
  169. lab67.grid(row=4, column=6, padx=(3, 0), sticky='ew')
  170.  
  171. lab68 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=2, anchor='center')
  172. lab68.grid(row=4, column=7, padx=(3, 0), sticky='ew')
  173. # --------------------------------------------
  174. lab71 = Label(f2, text='    в т.ч.: предоставени аванси', font="Timesbg, 7", justify='left', bg='white', height=1, width=62, anchor='w')
  175. lab71.grid(row=5, column=0, padx=(0, 0), sticky='nsew')
  176.  
  177. lab72 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
  178. lab72.grid(row=5, column=1, padx=(3, 0), sticky='ew')
  179.  
  180. lab73 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
  181. lab73.grid(row=5, column=2, padx=(3, 0), sticky='ew')
  182.  
  183. lab74 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
  184. lab74.grid(row=5, column=3, padx=(3, 0), sticky='ew')
  185.  
  186. lab75 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  187. lab75.grid(row=5, column=4, padx=(3, 0), sticky='ew')
  188.  
  189. lab76 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  190. lab76.grid(row=5, column=5, padx=(3, 0), sticky='ew')
  191.  
  192. lab77 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  193. lab77.grid(row=5, column=6, padx=(3, 0), sticky='ew')
  194.  
  195. lab78 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
  196. lab78.grid(row=5, column=7, padx=(3, 0), sticky='ew')
  197. # --------------------------------------------
  198. lab81 = Label(f2, text='Общо за група I.', font=("Times", 7, "bold"), justify='left', bg='white', height=1, width=62, anchor='w')
  199. lab81.grid(row=6, column=0, padx=(0, 0), sticky='nsew')
  200.  
  201. lab82 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1, anchor='e')
  202. lab82.grid(row=6, column=1, padx=(3, 0), sticky='ew')
  203.  
  204. lab83 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='grey', height=1)
  205. lab83.grid(row=6, column=2, padx=(3, 0), sticky='ew')
  206.  
  207. lab84 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='green', height=1)
  208. lab84.grid(row=6, column=3, padx=(3, 0), sticky='ew')
  209.  
  210. lab85 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  211. lab85.grid(row=6, column=4, padx=(3, 0), sticky='ew')
  212.  
  213. lab86 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  214. lab86.grid(row=6, column=5, padx=(3, 0), sticky='ew')
  215.  
  216. lab87 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1)
  217. lab87.grid(row=6, column=6, padx=(3, 0), sticky='ew')
  218.  
  219. lab88 = Label(f2, text='\n12 005.23\n', font="Timesbg, 7", justify='right', bg='white', height=1, anchor='center')
  220. lab88.grid(row=6, column=7, padx=(3, 0), sticky='ew')
  221.  
  222. print(can0['width'])
  223.  
  224.  
  225. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement