{"id":2860,"date":"2012-01-24T15:09:44","date_gmt":"2012-01-24T20:09:44","guid":{"rendered":"http:\/\/cemclinux1.math.uwaterloo.ca\/~cscircles\/wordpress\/?page_id=2860"},"modified":"2012-01-24T15:09:44","modified_gmt":"2012-01-24T20:09:44","slug":"7-rich-editor","status":"publish","type":"page","link":"https:\/\/olescs.hkmu.edu.hk\/python\/7-rich-editor\/","title":{"rendered":"7: Rich Editor"},"content":{"rendered":"<!-- Please retain this notice and add more notes if you create a new version.<br \/>\nOriginal lesson author: David Pritchard, daveagp@gmail.com, http:\/\/cscircles.ca<br \/>\nLicense: http:\/\/creativecommons.org\/licenses\/by-nc-sa\/3.0\/-->\n<p>The remainder of the lessons allow you to use an editor with \"rich features.\" Take a look inside the box below. <form class=\"pbform\" action=\"#\" id=\"pbform0\" method=\"POST\">\n<div class='pybox modeNeutral  facultative' id='pybox0'>\n<div class=\"heading\"><span class='type'>Example: <\/span><span class='title'>Rich Editor Demo<\/span><\/div>Try out the rich editor.<div class='pyboxTextwrap pyboxCodewrap RW resizy'  style='height: 526px;'><textarea wrap='off' name='usercode0' id='usercode0'  cols=10 rows=20   class='pyboxCode RW'>\ninfo = \"The rich editor does syntax highlighting\"\n# It resizes automatically. Drag the bottom border for manual size.\ncool = True\nfor i in range(0, max(3, 1+2*3-4)):\n   print('It also colours matching parentheses as you type')\n<\/textarea><\/div>\n<div id='pbhistory0' class='flexcontain' style='display:none;'><\/div>\n<input type='hidden' id='defaultCode0' value='info = \\\"The rich editor does syntax highlighting\\\"\\n# It resizes automatically. Drag the bottom border for manual size.\\ncool = True\\nfor i in range(0, max(3, 1+2*3-4)):\\n   print(\\u0027It also colours matching parentheses as you type\\u0027)\\n'><\/input>\n<div class='pyboxbuttons'><table><tr>\n<td><input type='submit' name='submit' id='submit0' value=' '\/><\/td>\n<td><input type='button' name='consolecopy' value=\"Open in console\" onclick=\"pbConsoleCopy(0)\" ><\/td>\n<td><input type='button' name='visualize' value=\"Visualize\" onclick=\"pbVisualize(0,'N')\" ><\/td>\n<td><input type='button' name='history' value=\"History\" onclick=\"historyClick(0,'7.sample')\" ><\/td>\n<\/tr><\/table><select id='pbSelect0' class='selectmore'><option name='more'>More actions...<\/option>\n<option name='default' data-pbonclick=\"pbSetText(0,descape($('#defaultCode0').val()))\" >Reset code to default<\/option>\n<\/select><\/div>\n<input type=\"hidden\" name=\"lang\" value=\"en-US\"\/><input type=\"hidden\" id=\"inputInUse0\" name=\"inputInUse\" value=\"Y\"\/>\n<input type=\"hidden\" name=\"pyId\" value=\"0\"\/>\n<input type=\"hidden\" name=\"hash\" value=\"06ca5644301dbe0c898f0a1e1cd094e8\"\/>\n<div id='pbresults0' class='pbresults avoidline'><\/div>\n<\/div>\n<\/form>\n<script type='text\/javascript'>jQuery(function(){pbToggleCodeMirror(0);});document.getElementById(\"submit0\").value = \"Run program\";document.getElementById(\"inputInUse0\").value = \"N\";<\/script>\n You can submit, save and load with the editor as usual. <table class='pywarn'><tr><td class='pywarnleft'><img src='https:\/\/olescs.hkmu.edu.hk\/python\/wp-content\/plugins\/pybox\/files\/warning.png'\/><\/td><td class='pywarnright'><span> The rich editor is used for all further lessons. <\/span><\/td><\/table> This lesson is <em>so<\/em> rich, it has three sub-lessons, which can be completed in any order. Pick one to continue:<\/p>\n<ol style=\"list-style-type: upper-alpha\">\n<li><a class=\"open-same-window\" href=\"..\/7a-strings\/\">strings (chunks of text) and characters (letters and digits).<\/a><\/li>\n<li><a class=\"open-same-window\" href=\"..\/7b-math\/\">math operations (*, +, -, \/), parentheses, and importing methods from the\u00a0<code>math<\/code>\u00a0module.<\/a><\/li>\n<li><a class=\"open-same-window\" href=\"..\/7c-loops\/\">creating\u00a0<code>while<\/code>\u00a0and\u00a0<code>for<\/code>\u00a0loops, and controlling program flow with\u00a0<code>break<\/code>\u00a0and\u00a0<code>continue<\/code>.<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>The remainder of the lessons allow you to use an editor with \"rich features.\" Take a look inside the box below. Example: Rich Editor DemoTry out the rich editor. info = \"The rich editor does syntax highlighting\" # It resizes &hellip; <a href=\"https:\/\/olescs.hkmu.edu.hk\/python\/7-rich-editor\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2860","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/pages\/2860"}],"collection":[{"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/comments?post=2860"}],"version-history":[{"count":0,"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/pages\/2860\/revisions"}],"wp:attachment":[{"href":"https:\/\/olescs.hkmu.edu.hk\/python\/wp-json\/wp\/v2\/media?parent=2860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}