����JFIF��H�H�����C� %# , #&')*)-0-(0%()(���C (((((((((((((((((((((((((((((((((((((((((((((((((((�������������������������������������������������P������������������������A�!)10������""������"*��@��������#+�OK&������2�Ec�xo����"�P��B}���������������������:9:9=<G$���S,�"5�R2�i��ғ��3ʥ�3@�;":%885I@��e� E��"�H�Z���ς�Z9 .��������[+��M�������������������,��������0" !1234#$5@P`�������?�$|�,.,���1�:�Q��<(���Q�Xi�*3���|T��}h�� L,I�V��|�hoZ��9��ȅ*�+�%��Y_�|5fcq�A�<���"8#_i���x���|�pۨ��p�+a�Q�uoŝȡ`sޚ5�n���.�:v��]�Mk��E�Gh�Ѐ"��B���i�f�<��O:��J�ԍ]o�҈g��Zz�!Xg{<6R�{�x'��`M����?�[Z�ط#5y�t�L�7S�) �vX���^�݈���;=�@^���Ƽ��� �� h��5� ���\��������������������������?4������������������������?4�����4� �������!1"02AQqa 3B��#@P`r��������?��f`��Y�ʉ�j����Zkx��@N�JaS������}����r��t��SɁ�3�p�e��W*͎�z4v\�c����`zdg�dGu3�� ��=�2p*��#��l�9�<���A���Pu��k�������8� � �4k*;���������8���2�b��VӋE�t�[0�kmli�㵑39�i����2��o} mM����kF \�:2�+w{{���-��$xVRkEA�N�]�^�R�[ryeV�G*G4��m�mӃ�N�!��hF�v��I�R��D�_�Q�p��T[l��D�.nNӢ����O��˚�i7+�=�=8qJ���'����K�B{���K�͟e�5���:����e��1��w�m��[MA���č��Vj��mȵ�z)�� č��}��n�(���9��?���)��������!1AQ0aq��� ��@�P`����?!��@v�,c�֟$M��6_���⠾SD$��!�/Y��:�NQ���!�c(��^��b�y��u��+�.H�U$�%嗗��ry�N>��]����X0�2D�q�q}Z��˥4ao����M,E�؇Uq� �Ϙc�AC\��:�+R��-�/9�Z �O�A*��|��+,u�~�#G �B" ���D�X1��_�VwP���OY��"�d��+V�a�\�t�v�^��[��j�c3�^�f4 KTFS��cNI��F���x1F9 �m��@��YڭQ�+(��D��Dߵ[���$�M���&��D�Z�V��&ձGi�@�t}�к�/+�4����wd0Dh���� ��aa�M='�g�UK�M��7�M+�O}�� ��4�r�ԋ�t��g\F,0���k��aX���U� ��5y��6�@�2�� ��DmZ�V{�9]A�.m�EKZ��2 ���?���������I$�I$�I$�I$�I$�I$�I$�I$A$�I$�@$I$�I I$�I ��$�I$�I$I$�II$�I$� �I$�I$�I$�I�A$�I$� �I$��$�I @�I$�$�I$�I �@$�I$�I$�I$�I$�I$�����������������������?4������������������������?4�����+��������!1AQ�aq�0����� ��@P`����?�����(Ir��ʲo��(��#)�0�a �?&�4�0�~��4Տ���K�Fhg~�����թ̛]NH ����}��N��:��5{y���o�BNb���s������C��t��kM�)j*D��$<�������gN���C��s%A#�*��=�@`䠴�?T+�U}�b��ʩ� D+�ϪG����!������j_�*)C�_ЂG�%�ү�4�X��T���IH������0r�"�%\~�%aJ��3�����iԁ �_�!�G�d ;�O�=$ VXx�� ����B�KSZtk�&�#��)�p0�P��Q.��M�9!�ۋne)��ҧ����4'��4$��)�F�^�v��� ��1j�f�z�U�K0�m�V=AA&C����"��gzu%�`08[^���Us���7��нWźU��� �z����4)B��e-�HV%Hh7�ԑ��A(�>hP��\�%a�[lL�_n{Ґ���V4n�FX�D+��1Kt�Z��\��!2��)Y��9�Em8�,��_WeD3¢���a��zW��L�3���d^-�����A��}�Y�g�(A�бx�P>ƌH��ߤ;Vn�q������JH� ?�� A�0�H��E�������jV�U��&H����� ��I�b&3�MF@H��L�E� CV-k6 �T:W���&3y��-օ�cB�6�#�h�VL{Q�0 ���Y��
One Hat Cyber Team
One Hat Cyber Team
Your IP :
3.148.179.161
Server IP :
167.114.57.54
Server :
Linux vps.riaoverseas.com 3.10.0-1160.15.2.el7.x86_64 #1 SMP Wed Feb 3 15:06:38 UTC 2021 x86_64
Server Software :
Apache
PHP Version :
8.0.18
Buat File
|
Buat Folder
Dir :
~
/
usr
/
lib64
/
python2.7
/
Demo
/
turtle
/
View File Name :
turtleDemo.py
#! /usr/bin/env python import sys import os from Tkinter import * from idlelib.Percolator import Percolator from idlelib.ColorDelegator import ColorDelegator from idlelib.textView import TextViewer import turtle import time STARTUP = 1 READY = 2 RUNNING = 3 DONE = 4 EVENTDRIVEN = 5 menufont = ("Arial", 12, NORMAL) btnfont = ("Arial", 12, 'bold') txtfont = ('Lucida Console', 8, 'normal') def getExampleEntries(): cwd = os.getcwd() if "turtleDemo.py" not in os.listdir(cwd): print "Directory of turtleDemo must be current working directory!" print "But in your case this is", cwd sys.exit() entries1 = [entry for entry in os.listdir(cwd) if entry.startswith("tdemo_") and not entry.endswith(".pyc")] entries2 = [] for entry in entries1: if entry.endswith(".py"): entries2.append(entry) else: path = os.path.join(cwd,entry) sys.path.append(path) subdir = [entry] scripts = [script for script in os.listdir(path) if script.startswith("tdemo_") and script.endswith(".py")] entries2.append(subdir+scripts) return entries2 def showDemoHelp(): TextViewer(demo.root, "Help on turtleDemo", "demohelp.txt") def showAboutDemo(): TextViewer(demo.root, "About turtleDemo", "about_turtledemo.txt") def showAboutTurtle(): TextViewer(demo.root, "About the new turtle module", "about_turtle.txt") class DemoWindow(object): def __init__(self, filename=None): #, root=None): self.root = root = turtle._root = Tk() root.wm_protocol("WM_DELETE_WINDOW", self._destroy) ################# self.mBar = Frame(root, relief=RAISED, borderwidth=2) self.mBar.pack(fill=X) self.ExamplesBtn = self.makeLoadDemoMenu() self.OptionsBtn = self.makeHelpMenu() self.mBar.tk_menuBar(self.ExamplesBtn, self.OptionsBtn) #, QuitBtn) root.title('Python turtle-graphics examples') ################# self.left_frame = left_frame = Frame(root) self.text_frame = text_frame = Frame(left_frame) self.vbar = vbar =Scrollbar(text_frame, name='vbar') self.text = text = Text(text_frame, name='text', padx=5, wrap='none', width=45) vbar['command'] = text.yview vbar.pack(side=LEFT, fill=Y) ##################### self.hbar = hbar =Scrollbar(text_frame, name='hbar', orient=HORIZONTAL) hbar['command'] = text.xview hbar.pack(side=BOTTOM, fill=X) ##################### text['yscrollcommand'] = vbar.set text.config(font=txtfont) text.config(xscrollcommand=hbar.set) text.pack(side=LEFT, fill=Y, expand=1) ##################### self.output_lbl = Label(left_frame, height= 1,text=" --- ", bg = "#ddf", font = ("Arial", 16, 'normal')) self.output_lbl.pack(side=BOTTOM, expand=0, fill=X) ##################### text_frame.pack(side=LEFT, fill=BOTH, expand=0) left_frame.pack(side=LEFT, fill=BOTH, expand=0) self.graph_frame = g_frame = Frame(root) turtle._Screen._root = g_frame turtle._Screen._canvas = turtle.ScrolledCanvas(g_frame, 800, 600, 1000, 800) #xturtle.Screen._canvas.pack(expand=1, fill="both") self.screen = _s_ = turtle.Screen() turtle.TurtleScreen.__init__(_s_, _s_._canvas) self.scanvas = _s_._canvas #xturtle.RawTurtle.canvases = [self.scanvas] turtle.RawTurtle.screens = [_s_] self.scanvas.pack(side=TOP, fill=BOTH, expand=1) self.btn_frame = btn_frame = Frame(g_frame, height=100) self.start_btn = Button(btn_frame, text=" START ", font=btnfont, fg = "white", disabledforeground = "#fed", command=self.startDemo) self.start_btn.pack(side=LEFT, fill=X, expand=1) self.stop_btn = Button(btn_frame, text=" STOP ", font=btnfont, fg = "white", disabledforeground = "#fed", command = self.stopIt) self.stop_btn.pack(side=LEFT, fill=X, expand=1) self.clear_btn = Button(btn_frame, text=" CLEAR ", font=btnfont, fg = "white", disabledforeground = "#fed", command = self.clearCanvas) self.clear_btn.pack(side=LEFT, fill=X, expand=1) self.btn_frame.pack(side=TOP, fill=BOTH, expand=0) self.graph_frame.pack(side=TOP, fill=BOTH, expand=1) Percolator(text).insertfilter(ColorDelegator()) self.dirty = False self.exitflag = False if filename: self.loadfile(filename) self.configGUI(NORMAL, DISABLED, DISABLED, DISABLED, "Choose example from menu", "black") self.state = STARTUP def _destroy(self): self.root.destroy() sys.exit() def configGUI(self, menu, start, stop, clear, txt="", color="blue"): self.ExamplesBtn.config(state=menu) self.start_btn.config(state=start) if start==NORMAL: self.start_btn.config(bg="#d00") else: self.start_btn.config(bg="#fca") self.stop_btn.config(state=stop) if stop==NORMAL: self.stop_btn.config(bg="#d00") else: self.stop_btn.config(bg="#fca") self.clear_btn.config(state=clear) self.clear_btn.config(state=clear) if clear==NORMAL: self.clear_btn.config(bg="#d00") else: self.clear_btn.config(bg="#fca") self.output_lbl.config(text=txt, fg=color) def makeLoadDemoMenu(self): CmdBtn = Menubutton(self.mBar, text='Examples', underline=0, font=menufont) CmdBtn.pack(side=LEFT, padx="2m") CmdBtn.menu = Menu(CmdBtn) for entry in getExampleEntries(): def loadexample(x): def emit(): self.loadfile(x) return emit if isinstance(entry,str): CmdBtn.menu.add_command(label=entry[6:-3], underline=0, font=menufont, command=loadexample(entry)) else: _dir, entries = entry[0], entry[1:] CmdBtn.menu.choices = Menu(CmdBtn.menu) for e in entries: CmdBtn.menu.choices.add_command(label=e[6:-3], underline=0, font=menufont, command = loadexample(os.path.join(_dir,e))) CmdBtn.menu.add_cascade(label=_dir[6:], menu = CmdBtn.menu.choices, font=menufont ) CmdBtn['menu'] = CmdBtn.menu return CmdBtn def makeHelpMenu(self): CmdBtn = Menubutton(self.mBar, text='Help', underline=0, font = menufont) CmdBtn.pack(side=LEFT, padx='2m') CmdBtn.menu = Menu(CmdBtn) CmdBtn.menu.add_command(label='About turtle.py', font=menufont, command=showAboutTurtle) CmdBtn.menu.add_command(label='turtleDemo - Help', font=menufont, command=showDemoHelp) CmdBtn.menu.add_command(label='About turtleDemo', font=menufont, command=showAboutDemo) CmdBtn['menu'] = CmdBtn.menu return CmdBtn def refreshCanvas(self): if not self.dirty: return self.screen.clear() #self.screen.mode("standard") self.dirty=False def loadfile(self,filename): self.refreshCanvas() if os.path.exists(filename) and not os.path.isdir(filename): # load and display file text f = open(filename,'r') chars = f.read() f.close() self.text.delete("1.0", "end") self.text.insert("1.0",chars) direc, fname = os.path.split(filename) self.root.title(fname[6:-3]+" - a Python turtle graphics example") self.module = __import__(fname[:-3]) reload(self.module) self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED, "Press start button", "red") self.state = READY def startDemo(self): self.refreshCanvas() self.dirty = True turtle.TurtleScreen._RUNNING = True self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED, "demo running...", "black") self.screen.clear() self.screen.mode("standard") self.state = RUNNING try: result = self.module.main() if result == "EVENTLOOP": self.state = EVENTDRIVEN else: self.state = DONE except turtle.Terminator: self.state = DONE result = "stopped!" if self.state == DONE: self.configGUI(NORMAL, NORMAL, DISABLED, NORMAL, result) elif self.state == EVENTDRIVEN: self.exitflag = True self.configGUI(DISABLED, DISABLED, NORMAL, DISABLED, "use mouse/keys or STOP", "red") def clearCanvas(self): self.refreshCanvas() self.scanvas.config(cursor="") self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED) def stopIt(self): if self.exitflag: self.clearCanvas() self.exitflag = False self.configGUI(NORMAL, NORMAL, DISABLED, DISABLED, "STOPPED!", "red") turtle.TurtleScreen._RUNNING = False #print "stopIT: exitflag = True" else: turtle.TurtleScreen._RUNNING = False #print "stopIt: exitflag = False" if __name__ == '__main__': demo = DemoWindow() RUN = True while RUN: try: print "ENTERING mainloop" demo.root.mainloop() except AttributeError: print "CRASH!!!- WAIT A MOMENT!" time.sleep(0.3) print "GOING ON .." demo.refreshCanvas() ## time.sleep(1) except: RUN = FALSE