<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8339615546260040703</id><updated>2024-09-24T18:14:45.586-07:00</updated><category term="python"/><category term="pygtk"/><category term="svn"/><category term="Eco"/><category term="code syntax"/><category term="openGL"/><category term="py2exe"/><category term="pyserial"/><category term="win32api"/><title type='text'>Waynec le monde</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>15</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-5734457070782536012</id><published>2008-08-02T15:20:00.000-07:00</published><updated>2008-12-09T11:23:34.765-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="py2exe"/><category scheme="http://www.blogger.com/atom/ns#" term="pygtk"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>PyGtk and Py2exe</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX88KYEzYvI1uuzOBCqd57DTs0xm5cp6mTF59AaCPy-SdO1-ycnDnMsOuo4uRKKevhHB_Eu6A_W38NvqzExxcP5i1duGbxJvu0BdH1Q3kUf_dkRqBdDJlqn1Hxy5H9KvIgb74h2mX1IcWE/s1600-h/Eco+Manager.PNG&quot;&gt;&lt;img style=&quot;display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX88KYEzYvI1uuzOBCqd57DTs0xm5cp6mTF59AaCPy-SdO1-ycnDnMsOuo4uRKKevhHB_Eu6A_W38NvqzExxcP5i1duGbxJvu0BdH1Q3kUf_dkRqBdDJlqn1Hxy5H9KvIgb74h2mX1IcWE/s400/Eco+Manager.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5230592357781502098&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Eco Manager是用&lt;a href=&quot;http://www.python.org/&quot;&gt;python &lt;/a&gt;+ &lt;a href=&quot;http://www.pygtk.org/&quot;&gt;pygtk&lt;/a&gt;寫的，當然這個管理程式希望能包成exe。因此就想到&lt;a href=&quot;http://www.py2exe.org/&quot;&gt;py2exe&lt;/a&gt;，自已有try了很久，但是怎麼包都失敗。後來學弟有找到方法，只要把Gtk這資料夾裡的etc、lib、share三個資料夾copy放到py2exe的build出來的dict資料夾中就可以work了。</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/5734457070782536012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/5734457070782536012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/5734457070782536012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/5734457070782536012'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/08/pygtk-and-py2exe.html' title='PyGtk and Py2exe'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX88KYEzYvI1uuzOBCqd57DTs0xm5cp6mTF59AaCPy-SdO1-ycnDnMsOuo4uRKKevhHB_Eu6A_W38NvqzExxcP5i1duGbxJvu0BdH1Q3kUf_dkRqBdDJlqn1Hxy5H9KvIgb74h2mX1IcWE/s72-c/Eco+Manager.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-4064392587123642017</id><published>2008-08-01T14:08:00.000-07:00</published><updated>2008-08-01T15:05:07.701-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python subprocess</title><content type='html'>DataGrabber是之前參加es2008的作品，裡面的Sensor是&lt;a href=&quot;http://www.ecomote.net/&quot;&gt;Eco&lt;/a&gt;，host端目前使用window + python。主要内容是用來操控window圖型介面，其中會用到開啟資料夾的指令。&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;subprocess&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Popen&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;explorer /n,&#39;&lt;/span&gt;+filepath&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/4064392587123642017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/4064392587123642017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4064392587123642017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4064392587123642017'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/08/python-subprocess.html' title='Python subprocess'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-7624696545225621736</id><published>2008-07-31T09:02:00.000-07:00</published><updated>2008-08-01T15:07:56.946-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pygtk"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>PyGtk ProgressBar</title><content type='html'>在upload、dump、erase binary file到&lt;a href=&quot;http://www.ecomote.net/&quot;&gt;Eco&lt;/a&gt;上，我們會想知道現在進行的進度。PyGtk中有一個ProgressBar可以拿來使用，Upload的時候，會知道現在透過rs232已經送出了多少bytes，並且也知道整個要上傳binary file的總bytes。&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;class&lt;/span&gt; ProgressBar:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000cd;&quot;&gt;__init__&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;,gladefile,bar_name&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt; = gladefile&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;dialogboxname&lt;/span&gt; = &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;progressbar_dialog1&quot;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar_name&lt;/span&gt; = bar_name&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; run&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;wTree&lt;/span&gt; = gtk.&lt;span style=&quot;color: black;&quot;&gt;glade&lt;/span&gt;.&lt;span style=&quot;color: #dc143c;&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt;,&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;dialogboxname&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;progressbar&lt;/span&gt; = &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;wTree&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;get_widget&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;dialogboxname&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar&lt;/span&gt; = &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;wTree&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;get_widget&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;progressbar1&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;set_text&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar_name&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; close&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;progressbar&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;destroy&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; set_fraction&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;,val&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; val &amp;lt;= &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;and&lt;/span&gt; val &amp;gt;= &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;set_fraction&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;val&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;bar&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;set_fraction&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#http://faq.pygtk.org/index.py?req=show&amp;amp;file=faq23.020.htp&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;while&lt;/span&gt; gtk.&lt;span style=&quot;color: black;&quot;&gt;events_pending&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gtk.&lt;span style=&quot;color: black;&quot;&gt;main_iteration&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;因此create出來的bar object，只要使用set_fraction傳入目前已完成百分比。&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/7624696545225621736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/7624696545225621736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7624696545225621736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7624696545225621736'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/pygtk-progressbar.html' title='PyGtk ProgressBar'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-1918146602420391734</id><published>2008-07-30T02:46:00.000-07:00</published><updated>2008-07-30T09:15:07.891-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pygtk"/><category scheme="http://www.blogger.com/atom/ns#" term="pyserial"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Pyserial scan serial prot</title><content type='html'>之前替Lab寫了一個Python + PyGtk的GUI程式，目的是為了Lab的Sensor &lt;a href=&quot;http://www.ecomote.net/&quot;&gt;Eco&lt;/a&gt;要賣，所以要提供一個簡單的GUI環境，讓使用者能夠從Lab Server下載包好的binary file，並且對Eco的EEPROM做dump、erase、upload、verify等動作。Eco connection是透過RS232，因為usb driver還沒寫好0rz，目前先用RS232將就一下。下面是python套件pyserial掃windows and linux serial port我的寫法。&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; scan_serialprot&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; available = &lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;256&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;try&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt; == &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;nt&quot;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s = serial.&lt;span style=&quot;color: black;&quot;&gt;Serial&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; available.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;i,s.&lt;span style=&quot;color: black;&quot;&gt;portstr&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s.&lt;span style=&quot;color: black;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;name&lt;/span&gt; == &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;posix&quot;&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ser_name = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;/dev/ttyUSB&#39;&lt;/span&gt; + &lt;span style=&quot;color: #008000;&quot;&gt;str&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;i&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s = serial.&lt;span style=&quot;color: black;&quot;&gt;Serial&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;ser_name&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; available.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;i,s.&lt;span style=&quot;color: black;&quot;&gt;portstr&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; s.&lt;span style=&quot;color: black;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;pass&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;except&lt;/span&gt; serial.&lt;span style=&quot;color: black;&quot;&gt;SerialException&lt;/span&gt;:&lt;br /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;pass&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; available&lt;/div&gt;&lt;br /&gt;linux那邊是因為我們用的是usb轉rs232的chip，所以我們要用/dev/ttyUSB之類的device name去scan。</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/1918146602420391734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/1918146602420391734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1918146602420391734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1918146602420391734'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/python-pyserial-scan-serial-prot.html' title='Python Pyserial scan serial prot'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-919996266588924456</id><published>2008-07-29T06:46:00.000-07:00</published><updated>2008-07-29T08:53:56.849-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>How to use Subversion</title><content type='html'>如果os是linux base的話。只有一些instruction要背。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn import&lt;br /&gt;$svn list&lt;br /&gt;$svn checkout&lt;br /&gt;$svn commit&lt;br /&gt;$svn update&lt;br /&gt;$svn add&lt;br /&gt;$svn rm&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;首先自已寫的project如果想要上傳到svn自已的repository中的話，要先用svn import這個指令把project import到svn自已的repository中。假設repository是waynec，local端project資料夾是GATE_0803，指令為：&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn import GATE_0803 svn://url/svnroot/waynec/GATE_0803&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;如果想要知道是否成功，可以用svn list這個指令。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn list svn://url/svnroot/waynec&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;接下來，要做的事情是取得svn server上project的working copy，working copy是一份從資料庫裡check out出來的檔案，這份檔案除了含有原本的內容之外，svn會另外增加.svn資料夾，裡面存放著每個檔案的版本資訊等資料，所以我們要有working copy才能夠跟資料庫做同步的動作。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn checkout svn://url/svnroot/waynec/GATE_0803&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;以上指令就會把svn server的project GATE_0803，copy一份到自已電腦上並且與svn server做同步。如果用ls -a指令看的話，會發現GATE_0803下面的每一個資料夾，都多了一個.svn的資料夾，這是svn加上去做控制的資訊。&lt;br /&gt;&lt;br /&gt;之後在此資料夾下做某些檔案的修改之後想要到一個段落，可以用svn commit去更新server的project。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn commit&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;如果project很多人一起修改，在進行編輯前，先使用svn update指令去確定目前自已project資料夾與server上是一樣版本。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn update&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;因為svn會透過.svn這個資料夾來紀錄檔案的版本資訊，因此任何不在.svn裡面有紀錄的檔案，svn都無法進行版本控制，所以，當我們新增一個不在repository裡面的檔案的時候，我們必須要用svn add來把把資訊放到.svn裡面。&lt;br /&gt; &lt;br /&gt;&lt;code&gt;$svn add C.txt&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;這樣之後才能使用svn commit去更新svn server也新增此檔案。一樣如果要刪除某檔案，也要先通知自已資料夾的.svn。之後再svn commit通知server也刪除此檔案。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn rm C.txt&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;另外，如果只是想copy一份project下來，並不想與svn server做同步，可以用svn export。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svn export svn://url/svnroot/waynec/GATE_0803&lt;br /&gt;&lt;/code&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/919996266588924456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/919996266588924456' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/919996266588924456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/919996266588924456'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/how-to-use-subversion.html' title='How to use Subversion'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-4159061613191889217</id><published>2008-07-28T10:26:00.000-07:00</published><updated>2008-07-29T08:53:28.166-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>Subversion Introduction</title><content type='html'>最近Lab學長要畢業，我要接管Lab Server。第一個任務就是svn管理，除了開新帳號之外，還要教學弟他們怎麼使用。&lt;br /&gt;&lt;br /&gt;開帳號部分，首先開repository，svn上repository就是存放project的地方。Lab的習慣是毎個人的ID是一個repository，毎個人負責的project、demo相關資料或論文都可放上去。&lt;br /&gt;要建立一個repository，我們可以使用svnadmin create這個指令&lt;br /&gt;&lt;br /&gt;&lt;code&gt;$svnadmin create /svnroot/id&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;之後切換到/home/svnroot/id/conf的資料夾下，設定passwd的使用者id and passwd。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;[users]&lt;br /&gt;test = test&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;並且修改svnserve.conf，把三行註解拿掉。&lt;br /&gt;&lt;br /&gt;&lt;code&gt;[general]&lt;br /&gt;anon-access = read&lt;br /&gt;auth-access = write&lt;br /&gt;password-db = passwd&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;此id的使用者就能用設定的帳密去使用。&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/4159061613191889217/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/4159061613191889217' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4159061613191889217'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4159061613191889217'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/subversion-introduction.html' title='Subversion Introduction'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-5303174112503465729</id><published>2008-07-27T13:21:00.000-07:00</published><updated>2008-07-27T14:02:46.967-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="code syntax"/><title type='text'>Code Syntax HightLight</title><content type='html'>今天找了一下有關在Blogger上顯示Code Hightligt的方法。&lt;br /&gt;&lt;a href=&quot;http://tools.devshed.com/webmaster-tools/syntax-highlighting/&quot;&gt;Syntax-highlight&lt;/a&gt;&lt;br /&gt;這個網站提供的，可以滿足大部份的程式語言。但是如果選擇顯示line number，post之後如果想要copy，格式在文字編輯器上會亂掉。&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/5303174112503465729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/5303174112503465729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/5303174112503465729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/5303174112503465729'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/code-syntax-hightlight.html' title='Code Syntax HightLight'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-6760003656268857842</id><published>2008-07-25T12:39:00.000-07:00</published><updated>2008-07-27T13:17:35.867-07:00</updated><title type='text'>Linux Pthread Programming</title><content type='html'>在Linux上program要使用到Pthread其實很平常，Socket的相關程式大都會用到。以下是部分程式碼&lt;br /&gt;&lt;div class=&quot;c&quot;&gt;&lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; *NM_TCP&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; *threadarg&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;unsigned&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;char&lt;/span&gt; *strAddr;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;unsigned&lt;/span&gt; &lt;span style=&quot;color: #993333;&quot;&gt;int&lt;/span&gt; *tcpPort;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;struct&lt;/span&gt; thread_data *data;&lt;br /&gt; &amp;nbsp; &amp;nbsp; data = &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;struct&lt;/span&gt; thread_data *&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;threadarg;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; strAddr = data-&amp;gt;addr;&lt;br /&gt; &amp;nbsp; &amp;nbsp; tcpPort = data-&amp;gt;port;&lt;br /&gt; &lt;br /&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;br /&gt; &lt;br /&gt; &lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; main&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;//parameter for pthread&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;struct&lt;/span&gt; thread_data&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;br /&gt; &amp;nbsp; &amp;nbsp; U8_T *opcode;&lt;br /&gt; &amp;nbsp; &amp;nbsp; U8_T *addr;&lt;br /&gt; &amp;nbsp; &amp;nbsp; U16_T *port;&lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #993333;&quot;&gt;struct&lt;/span&gt; thread_data trd_data;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; trd_data.&lt;span style=&quot;color: #202020;&quot;&gt;addr&lt;/span&gt; = inet_ntoa&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;UDPClntAddr.&lt;span style=&quot;color: #202020;&quot;&gt;sin_addr&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; trd_data.&lt;span style=&quot;color: #202020;&quot;&gt;opcode&lt;/span&gt; = &amp;amp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;SearchPacket.&lt;span style=&quot;color: #202020;&quot;&gt;Opcode&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt; &amp;nbsp; &amp;nbsp; trd_data.&lt;span style=&quot;color: #202020;&quot;&gt;port&lt;/span&gt; = &amp;amp;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;SearchPacket.&lt;span style=&quot;color: #202020;&quot;&gt;TcpPort&lt;/span&gt;&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt; &lt;br /&gt; &amp;nbsp; &amp;nbsp; pthread_create&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&amp;amp;nm_threads&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#91;&lt;/span&gt;thread_idx&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#93;&lt;/span&gt;,&lt;span style=&quot;color: #000000; font-weight: bold;&quot;&gt;NULL&lt;/span&gt;,NM_TCP,&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #993333;&quot;&gt;void&lt;/span&gt; *&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;amp;trdData&lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;br /&gt; &lt;span style=&quot;color: #66cc66;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;Reference&lt;br /&gt;&lt;a href=&quot;https://computing.llnl.gov/tutorials/pthreads/&quot;&gt;https://computing.llnl.gov/tutorials/pthreads/&lt;/a&gt;&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/6760003656268857842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/6760003656268857842' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/6760003656268857842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/6760003656268857842'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/linux-pthread-programming.html' title='Linux Pthread Programming'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-506084859637472380</id><published>2008-07-23T01:45:00.000-07:00</published><updated>2008-12-09T11:23:35.084-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pygtk"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Pygtk and Glade Event handle</title><content type='html'>使用Glade layout出想要的GUI介面之後，要處理的就是一些Button，像是Toolbar Button、Radio Button等的事件觸發。如下圖顯示，我們可以在Glade Singal Tab裡面，選擇GtkToolButton的Clicked Singal，然後填入自己想定義的Function Name。&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjLtoAr-Sr0At88AKK8F8d5KuCBcAx8lp1minSBNnpPL4-MbKXrRISTCKFrWC0vur8A9TyIfgBOqjWi1ty9Pob4tJ1087UfeSGz9szjGJ4Uo8bO5vEBfHckjqairrrL-0qfU4RaB9CjbKl/s1600-h/ToolButton.PNG&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjLtoAr-Sr0At88AKK8F8d5KuCBcAx8lp1minSBNnpPL4-MbKXrRISTCKFrWC0vur8A9TyIfgBOqjWi1ty9Pob4tJ1087UfeSGz9szjGJ4Uo8bO5vEBfHckjqairrrL-0qfU4RaB9CjbKl/s400/ToolButton.PNG&quot; border=&quot;0&quot; alt=&quot;&quot;id=&quot;BLOGGER_PHOTO_ID_5226133356483632642&quot; /&gt;&lt;/a&gt;&lt;br /&gt;之後在Python銜接的地方如下：&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color: #0000cd;&quot;&gt;__init__&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Set Glade File&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt; = &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;EPLab_Manager.glade&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#window Title Name&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;windowname&lt;/span&gt; = &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;EPL Manager&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Win&lt;/span&gt; = gtk.&lt;span style=&quot;color: black;&quot;&gt;glade&lt;/span&gt;.&lt;span style=&quot;color: #dc143c;&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt;,&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;windowname&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Create dictionary and connect to event handle function&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dic = &lt;span style=&quot;color: black;&quot;&gt;&amp;#123;&lt;/span&gt;\&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;on_manager_destroy&quot;&lt;/span&gt; : \&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;manager_quit&lt;/span&gt;,&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;on_tb2_version_clicked&quot;&lt;/span&gt; : \&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;on_toolbar_version_clicked&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: black;&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Win&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;signal_autoconnect&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;dic&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; on_toolbar_version_clicked&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;,widget&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;on_toolbar_version_clicked&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;如此就能連接GUI的設定與Event Handler，當使用者按下設定好的Toolbar Button，便會trigger on_toolbar_version_clicked這個function運作。但是不知道哪理出問題，如果想要使用GUI上面close按鈕來關閉視窗，一定要用gtk.main_quit()來離開整個程式。因此上述程式的on_manager_destroy就是連接整個GUI GtkObjec的destroy singal。另外，想要不使用Glade的方式來連接，也可以透過程式直接connect。&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Win&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;single_connect&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;destray&quot;&lt;/span&gt;,gtk.&lt;span style=&quot;color: black;&quot;&gt;main_quit&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;這種方式也可以。</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/506084859637472380/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/506084859637472380' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/506084859637472380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/506084859637472380'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/python-pygtk-and-glade-event-handle.html' title='Python Pygtk and Glade Event handle'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjLtoAr-Sr0At88AKK8F8d5KuCBcAx8lp1minSBNnpPL4-MbKXrRISTCKFrWC0vur8A9TyIfgBOqjWi1ty9Pob4tJ1087UfeSGz9szjGJ4Uo8bO5vEBfHckjqairrrL-0qfU4RaB9CjbKl/s72-c/ToolButton.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-1350161115671601696</id><published>2008-07-17T09:29:00.000-07:00</published><updated>2008-07-29T09:29:26.160-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="pygtk"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python pygtk and Glade</title><content type='html'>會碰pygtk其實是因為Lab最近要趕出一個Project，並且對外發售的套件老師希望能夠open source，當初是想要用C#撰寫，不過老師特別偏愛Python，配上其他的GUI的話，當然首推GTK，只要runtime environment灌好就可以在任何平臺趴趴走。&lt;br /&gt;&lt;br /&gt;首先到&lt;a href=&quot;http://www.pygtk.org/&quot;&gt;Pygtk&lt;/a&gt;下載套件，套件有三個Python、GTK environment、Pygtk三個。&lt;br /&gt;&lt;br /&gt;安裝完之後新增test.py並import的地方可以這樣寫&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; pygtk&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; pygtk.&lt;span style=&quot;color: black;&quot;&gt;require&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;2.0&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;error import pygtk&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;try&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; gtk&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; gtk.&lt;span style=&quot;color: black;&quot;&gt;glade&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;except&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;You need to install pyGTK or GTKv2 &quot;&lt;/span&gt;,&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;or set your PYTHONPATH correctly.&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://glade.gnome.org/&quot;&gt;Glade3&lt;/a&gt;是一個GTK的interface Designer，拖拉出來的檔案其實是xaml file、而且可以新增event handler，既然有現成的工具，除非是要動態新增或修改的，不然拖一拖就有個簡單的介面，其實非常方便。&lt;br /&gt;&lt;br /&gt;在Glade拉出一個介面之後，Python這邊就要來把.glade的file吃進來。&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt; = &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;EPLab_Manager.glade&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#window Title Name&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;windowname&lt;/span&gt; = &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;EPLab Manager&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;wTree&lt;/span&gt; = gtk.&lt;span style=&quot;color: black;&quot;&gt;glade&lt;/span&gt;.&lt;span style=&quot;color: #dc143c;&quot;&gt;XML&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;gladefile&lt;/span&gt;,&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;windowname&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;如此就把整個glade file放入wTree當中，之後想要使用或是修改某個component，只要透過&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;webview&lt;/span&gt; = &lt;span style=&quot;color: #008000;&quot;&gt;self&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;wTree&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;get_widget&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;treeview1&quot;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;來get GTK裡面treeview component，之後就可以透過&lt;br /&gt;&lt;a href=&quot;http://www.pygtk.org/pygtk2tutorial/index.html&quot;&gt;pyGTK tutorial&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.pygtk.org/docs/pygtk/index.html&quot;&gt;PyGTK 2.0 Reference Manual&lt;/a&gt;&lt;br /&gt;來查詢有哪些method或是property可以拿來使用。&lt;br /&gt;&lt;br/&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/1350161115671601696/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/1350161115671601696' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1350161115671601696'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1350161115671601696'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/07/python-pygtk-and-glade.html' title='Python pygtk and Glade'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-7928774198101652746</id><published>2008-06-03T06:11:00.000-07:00</published><updated>2008-07-27T11:52:22.417-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python binary string and list</title><content type='html'>&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#split data to list&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; data2list&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;datapath&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; f = &lt;span style=&quot;color: #008000;&quot;&gt;open&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;datapath,&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;r+b&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;f&#39;&lt;/span&gt;,f&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; datalist = &lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; data = f.&lt;span style=&quot;color: black;&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; limit = &lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;data&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;Origin Data Size = %d&amp;nbsp; byte&#39;&lt;/span&gt; %limit&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;limit/&lt;span style=&quot;color: #ff4500;&quot;&gt;256&lt;/span&gt;+&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; datalist.&lt;span style=&quot;color: black;&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;data&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;i*&lt;span style=&quot;color: #ff4500;&quot;&gt;256&lt;/span&gt;:i*&lt;span style=&quot;color: #ff4500;&quot;&gt;256&lt;/span&gt;+&lt;span style=&quot;color: #ff4500;&quot;&gt;256&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; f.&lt;span style=&quot;color: black;&quot;&gt;close&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; datalist&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#converge list element to binary data&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; list2data&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; binary = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; j = &lt;span style=&quot;color: #008000;&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;j&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; binary = binary + &lt;span style=&quot;color: #008000;&quot;&gt;list&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;i&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;return&lt;/span&gt; binary &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/7928774198101652746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/7928774198101652746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7928774198101652746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7928774198101652746'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/06/python-binary-string-and-list.html' title='Python binary string and list'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-2311417395045337446</id><published>2008-06-02T07:40:00.000-07:00</published><updated>2008-07-27T11:54:19.241-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><category scheme="http://www.blogger.com/atom/ns#" term="win32api"/><title type='text'>Python win32api</title><content type='html'>開啟window 視窗&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #dc143c;&quot;&gt;subprocess&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;Popen&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;explorer &amp;quot;C:&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\D&lt;/span&gt;ATA&amp;quot;&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;鍵盤模擬&lt;br /&gt;&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;xxxx,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;xxxx,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#19978;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_UP&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#19979;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_DOWN&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#24038;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_LEFT&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#21491;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_RIGHT&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#PrtSc&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_SNAPSHOT&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#ALT&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_MENU&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#CTRL&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_LCONTROL&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Tab&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_TAB&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#33521;&amp;amp;#25991;&amp;amp;#37749;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VkKeyScan&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;x&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#31354;&amp;amp;#30333;&amp;amp;#37749;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VK_SPACE&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#25918;&amp;amp;#22823;window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_MENU&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_SPACE&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VkKeyScan&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;x&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;time&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VkKeyScan&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;x&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_SPACE&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_MENU&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;amp;#36996;&amp;amp;#21407;window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_MENU&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_SPACE&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VkKeyScan&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;time&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;VkKeyScan&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;r&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_SPACE&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;win32api.&lt;span style=&quot;color: black;&quot;&gt;keybd_event&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;win32con.&lt;span style=&quot;color: black;&quot;&gt;VK_MENU&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,win32con.&lt;span style=&quot;color: black;&quot;&gt;KEYEVENTF_KEYUP&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/2311417395045337446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/2311417395045337446' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/2311417395045337446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/2311417395045337446'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/06/python-win32api.html' title='Python win32api'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-7650808975344695669</id><published>2008-05-05T07:02:00.000-07:00</published><updated>2008-07-27T12:00:42.796-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="openGL"/><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python OpenGL cube rotated by keypress</title><content type='html'>&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# -*- coding: utf-8 -*-&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;from&lt;/span&gt; OpenGL.&lt;span style=&quot;color: #dc143c;&quot;&gt;GL&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; *&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;from&lt;/span&gt; OpenGL.&lt;span style=&quot;color: black;&quot;&gt;GLUT&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; *&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;from&lt;/span&gt; OpenGL.&lt;span style=&quot;color: black;&quot;&gt;GLU&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; *&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; serial&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;os&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;threading&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;ESCAPE = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\0&lt;/span&gt;33&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_a = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;41&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_b = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;42&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_c = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;43&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_d = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;44&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_e = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;45&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;KEY_f = &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\1&lt;/span&gt;46&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Initiate the glut window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;window = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Rotation angle for the quadrilateral.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;X_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;Y_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;Z_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#AXIS direction&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;DIRECTION = &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# A general OpenGL initialization function.&amp;nbsp; Sets all of the initial parameters. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# We call this right after our OpenGL window is created.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; InitGL&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;Width, Height&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# This Will Clear The Background Color To Black&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glClearColor&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Enables Clearing Of The Depth Buffer&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glClearDepth&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# The Type Of Depth Test To Do&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glDepthFunc&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_LESS&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Enables Depth Testing&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glEnable&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_DEPTH_TEST&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Enables Smooth Color Shading&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glShadeModel&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_SMOOTH&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glMatrixMode&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_PROJECTION&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Reset The Projection Matrix&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glLoadIdentity&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Calculate The Aspect Ratio Of The Window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gluPerspective&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;45&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #008000;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;Width&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;/&lt;span style=&quot;color: #008000;&quot;&gt;float&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;Height&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;100&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glMatrixMode&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_MODELVIEW&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# The function called whenever a key is pressed. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Note the use of Python tuples to pass in: (key, x, y)&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; keyPressed&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;*args&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;global&lt;/span&gt; X_AXIS,Y_AXIS,Z_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;global&lt;/span&gt; DIRECTION&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# If escape is pressed, kill everything.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == ESCAPE:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;exit&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_a:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X_AXIS = X_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_b:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y_AXIS = Y_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_c:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Z_AXIS = Z_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_d:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = -&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X_AXIS = X_AXIS - &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_e:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = -&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y_AXIS = Y_AXIS - &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;elif&lt;/span&gt; args&lt;span style=&quot;color: black;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#93;&lt;/span&gt; == KEY_f:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; DIRECTION = -&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Z_AXIS = Z_AXIS - &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;30&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; DrawGLScene&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;global&lt;/span&gt; X_AXIS,Y_AXIS,Z_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;global&lt;/span&gt; DIRECTION&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#clear the screen and the depth buffer&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glClear&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Reset The View&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glLoadIdentity&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Move Right And Into The Screen&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glTranslatef&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;6&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Rotate The Cube On X&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glRotatef&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;X_AXIS,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Rotate The Cube On Y&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glRotatef&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;Y_AXIS,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Rotate The Cube On Z&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glRotatef&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;Z_AXIS,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Start Drawing The Cube&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glBegin&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GL_QUADS&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Blue&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Top)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Top)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Top)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Top)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Orange&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;5&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Bottom)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Bottom)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Bottom)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Bottom)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Red&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Front)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Front)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Front)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Front)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Yellow&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Back)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Back)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Back)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Back)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Blue&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Left)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Left)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Left)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Left)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Set The Color To Violet&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glColor3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Right Of The Quad (Right)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&amp;nbsp; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Top Left Of The Quad (Right)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Left Of The Quad (Right)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Bottom Right Of The Quad (Right)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glVertex3f&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;,-&lt;span style=&quot;color: #ff4500;&quot;&gt;1&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Done Drawing The Quad &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glEnd&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; X_AXIS &amp;gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; X_AXIS == &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; X_AXIS &amp;lt; -&lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; X_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; X_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; DIRECTION&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; X_AXIS = X_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;3&lt;/span&gt;*&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;DIRECTION&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; Y_AXIS &amp;gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; Y_AXIS == &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; Y_AXIS &amp;lt; -&lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; Y_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; Y_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; DIRECTION&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Y_AXIS = Y_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;3&lt;/span&gt;*&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;DIRECTION&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; Z_AXIS &amp;gt; &lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; Z_AXIS == &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;or&lt;/span&gt; Z_AXIS &amp;lt; -&lt;span style=&quot;color: #ff4500;&quot;&gt;360&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; Z_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Z_AXIS = &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;else&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; Z_AXIS&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; DIRECTION&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Z_AXIS = Z_AXIS + &lt;span style=&quot;color: #ff4500;&quot;&gt;0&lt;/span&gt;.&lt;span style=&quot;color: #ff4500;&quot;&gt;3&lt;/span&gt;*&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;DIRECTION&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#&amp;nbsp; since this is double buffered, swap the buffers to display what just got drawn. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutSwapBuffers&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; main&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;global&lt;/span&gt; window&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#initialize the GLUT library&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutInit&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;sys&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;argv&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#select display mode:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Bit mask to select an RGBA mode window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Bit mask to select a double buffered window&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#Bit mask to request a window with a depth buffer&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutInitDisplayMode&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#get a window size&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutInitWindowSize&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;640&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;480&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#the window starts at the upper left corner of the screen&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutInitWindowPosition&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;200&lt;/span&gt;,&lt;span style=&quot;color: #ff4500;&quot;&gt;200&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#create a window and set its title&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; window = glutCreateWindow&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;Pointer Demo&#39;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Register the drawing function with glut, BUT in Python land, &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# at least using PyOpenGL, we need to set the function pointer and &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# invoke a function to actually register the callback, &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# otherwise it would be very much like the C version of the code. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutDisplayFunc&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;DrawGLScene&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# When we are doing nothing, redraw the scene.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutIdleFunc&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;DrawGLScene&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Register the function called when the keyboard is pressed.&amp;nbsp; &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutKeyboardFunc&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;keyPressed&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;# Initialize our window. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; InitGL&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;640&lt;/span&gt;, &lt;span style=&quot;color: #ff4500;&quot;&gt;480&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #808080; font-style: italic;&quot;&gt;#start event processing engine&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; glutMainLoop&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;if&lt;/span&gt; __name__ == &lt;span style=&quot;color: #483d8b;&quot;&gt;&quot;__main__&quot;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; main&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/7650808975344695669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/7650808975344695669' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7650808975344695669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/7650808975344695669'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/05/python-opengl-cube-rotated-by-keypress.html' title='Python OpenGL cube rotated by keypress'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-1877815625822657070</id><published>2008-05-05T06:15:00.000-07:00</published><updated>2008-07-27T12:01:53.049-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="python"/><title type='text'>Python Thread</title><content type='html'>&lt;div class=&quot;python&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;thread&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;import&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;time&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;def&lt;/span&gt; counter&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;id&lt;/span&gt;,count&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;count&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;[%s] = %s&#39;&lt;/span&gt; %&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #008000;&quot;&gt;id&lt;/span&gt;,i&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;for&lt;/span&gt; i &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;in&lt;/span&gt; &lt;span style=&quot;color: #008000;&quot;&gt;range&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;:&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #dc143c;&quot;&gt;thread&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;start_new&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;counter,&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;i,&lt;span style=&quot;color: #ff4500;&quot;&gt;100&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #dc143c;&quot;&gt;time&lt;/span&gt;.&lt;span style=&quot;color: black;&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #ff4500;&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt; &lt;li style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; color: black; font-weight: normal; font-style: normal;&quot;&gt;&lt;div style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace; font-weight: normal;&quot;&gt;&lt;span style=&quot;color: #ff7700;font-weight:bold;&quot;&gt;print&lt;/span&gt; &lt;span style=&quot;color: #483d8b;&quot;&gt;&#39;exit&lt;span style=&quot;color: #000099; font-weight: bold;&quot;&gt;\n&lt;/span&gt;&#39;&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/1877815625822657070/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/1877815625822657070' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1877815625822657070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/1877815625822657070'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2008/05/python-thread.html' title='Python Thread'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8339615546260040703.post-4408235105139399796</id><published>2007-12-02T10:50:00.000-08:00</published><updated>2008-07-27T12:05:35.964-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Eco"/><title type='text'>Eco Basic Info</title><content type='html'>Nordic    nRF24E1&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.ecomote.net/video/Eco-SDCC-Program.m4v&quot;&gt;Eco SDCC&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.ecomote.net/video/Eco-EEPROM-writing.m4v&quot;&gt;Eco EEPROM&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.ecomote.net/software/&quot;&gt;Software&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://embedded.ece.uci.edu/cgi-bin/cvsweb.cgi/jiwon/EcoManual06/manual.pdf&quot;&gt;Manual&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://quadratic.ece.uci.edu/~eco/code/&quot;&gt;&lt;br /&gt;Eco Code&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.ecomote.net/software/EcoFW.zip&quot;&gt;EcoFirmWare&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://xwaynec.blogspot.com/feeds/4408235105139399796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/8339615546260040703/4408235105139399796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4408235105139399796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8339615546260040703/posts/default/4408235105139399796'/><link rel='alternate' type='text/html' href='http://xwaynec.blogspot.com/2007/12/eco-basic-info.html' title='Eco Basic Info'/><author><name>Waynec</name><uri>http://www.blogger.com/profile/01726154185108785802</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='26' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9uZW_2nANkyNz8__J0ei2Xstns5O044JVUaKmvL18-TE7ktdsLgJM2Lpt8iYWExeDJbwsqo6g1040s9cVKDNPo0tBqyQGv7y9KAIuR1GvI4TtMxRXbzhL4I0tX1leTNs/s220/圖片'/></author><thr:total>0</thr:total></entry></feed>