Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. from tkinter import *
  2.  
  3. root=Tk()
  4.  
  5. tex=Text(root, height=23, width=49,bg='black',font='System',fg='white',bd=0)
  6. tex.place(x=3,y=25)
  7. i=1
  8. z=7
  9. n=3
  10. d=4
  11. a=5
  12. for i in range(z):
  13. text=('A',i+2,'=','(',n,'- 1)','*',d,'+',a)
  14. tex.insert('2.2',text,)
  15.  
  16. root.mainloop()
  17.  
  18. for i in range(z):
  19. text=('A',i+2,'=','(',n,'- 1)','*',d,'+',a)
  20. tex.insert('2.2','{}n'.format(text))
  21.  
  22. #!/usr/bin/env python3
  23. from tkinter import Tk, Text
  24.  
  25. root = Tk()
  26. text = Text(root, height=23, width=49, bg='black', font='System',fg='white',bd=0)
  27. text.place(x=3, y=25)
  28. n, d, a = 3, 4, 5
  29. for i in range(7):
  30. text.insert('end', f'A{i+2} = ({n} - 1) * {d} + {a}n')
  31. root.mainloop()
  32.  
  33. #!/usr/bin/env python3
  34. from tkinter import Tk, Text
  35.  
  36. root = Tk()
  37. text = Text(root, height=23, width=49, bg='black', font='System',fg='white', bd=0)
  38. text.place(x=3, y=2)
  39.  
  40. def replace_text(i, n=3, d=4, a=5):
  41. text.delete("1.0", 'end')
  42. text.insert("1.0", f'A{i+2} = ({n} - 1) * {d} + {a}')
  43. if i < 6:
  44. text.after(500, replace_text, i+1) # replace the next line in .5 seconds
  45.  
  46. replace_text(0)
  47. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement