You've already forked AiraPulsar
clean pycache
This commit is contained in:
Binary file not shown.
Binary file not shown.
46
pulsar/main copy.py
Normal file
46
pulsar/main copy.py
Normal file
@@ -0,0 +1,46 @@
|
||||
import vgl
|
||||
import time
|
||||
|
||||
window = vgl.Window(title="Pulsar", size=(1024, 768))
|
||||
|
||||
def horizontal_indicator():
|
||||
global window
|
||||
frame = vgl.Frame().attach(window_object=window, poscale=(0, 0), clone_name="Horizontal Indicator")
|
||||
vgl.elements.Line(ends=[(0.4, 0.5), (0.6, 0.5)], color="green").attach(frame_object=frame)
|
||||
pass
|
||||
|
||||
@window.observerize
|
||||
def observer(info):
|
||||
if info["delta"] == "key":
|
||||
print(info)
|
||||
pass
|
||||
|
||||
def marking_lines():
|
||||
global window
|
||||
frame = vgl.Frame().attach(window_object=window, poscale=(0,0), clone_name="Marking Line")
|
||||
for i in range(0, 24):
|
||||
vgl.elements.Line(ends=[(0, i/24), (1, i/24)], color="green").attach(frame_object=frame)
|
||||
for i in range(0, 32):
|
||||
vgl.elements.Line(ends=[(i/32, 0), (i/32, 1)], color="green").attach(frame_object=frame)
|
||||
|
||||
def console():
|
||||
print("You've entered Pulsar's command console, an embbedded Python interpreter for debugging & testing")
|
||||
while True:
|
||||
try:
|
||||
i = input(">>> ")
|
||||
if i == "q":
|
||||
return
|
||||
exec(i)
|
||||
except:
|
||||
print("An error caused & captured")
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("Welcome to AiraPulsar Client")
|
||||
window.start()
|
||||
horizontal_indicator()
|
||||
marking_lines()
|
||||
observer()
|
||||
console()
|
||||
input("任意键以退出")
|
||||
window.kill()
|
||||
exit()
|
@@ -11,9 +11,11 @@ def horizontal_indicator():
|
||||
|
||||
@window.observerize
|
||||
def observer(info):
|
||||
print(info)
|
||||
if info["delta"] == "key":
|
||||
print(info)
|
||||
pass
|
||||
|
||||
def marking_lines():
|
||||
print("实例")
|
||||
global window
|
||||
frame = vgl.Frame().attach(window_object=window, poscale=(0,0), clone_name="Marking Line")
|
||||
for i in range(0, 24):
|
||||
@@ -25,7 +27,10 @@ def console():
|
||||
print("You've entered Pulsar's command console, an embbedded Python interpreter for debugging & testing")
|
||||
while True:
|
||||
try:
|
||||
exec(input(prompt=">>> "))
|
||||
i = input(">>> ")
|
||||
if i == "q":
|
||||
return
|
||||
exec(i)
|
||||
except:
|
||||
print("An error caused & captured")
|
||||
|
||||
@@ -35,7 +40,7 @@ if __name__ == '__main__':
|
||||
horizontal_indicator()
|
||||
marking_lines()
|
||||
observer()
|
||||
#console()
|
||||
console()
|
||||
input("任意键以退出")
|
||||
window.kill()
|
||||
exit()
|
Reference in New Issue
Block a user