5n6r

xSpace v0.01b

Feb 14th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. +-------------------------------------+
  2. | For use click the mouse and move it |
  3. +-------------------------------------+
  4.  
  5. # -*- coding: utf-8 -*-
  6. #!/usr/bin/env python3
  7. from tkinter import *
  8. from random import *
  9. import math
  10. chk=0
  11. def mous(event):
  12.     global chk
  13.     x0=event.x
  14.     y0=event.y
  15.     if chk==1:
  16.         c.create_oval(x0,y0,x0+10,y0+10,outline=choice(["lightblue","blue","darkblue"]))
  17.         c.update()
  18.     else:
  19.         pass
  20. def cl(event):
  21.     c.delete("all")
  22. def go(event)   :
  23.     global chk
  24.     if chk==0:
  25.         chk=1
  26.     else:
  27.         chk=0
  28. app=Tk()
  29. app.title(chr(9960)*3+" xSpace version 0.0.1 beta "+chr(169)+" 2017, coded by 5n6r "+chr(9960)*3)
  30. app.geometry("600x400")
  31. app.resizable(0,0)
  32. c=Canvas(app,width=599,heigh=399,bg="black",cursor = "pencil")
  33. c.bind("<Motion>",mous)
  34. c.bind("<Button-3>",cl)
  35. c.bind("<Button-1>",go)
  36. c.pack()
  37. app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment