{"id":933,"date":"2015-11-04T13:43:41","date_gmt":"2015-11-04T13:43:41","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/?p=933"},"modified":"2015-11-04T13:43:41","modified_gmt":"2015-11-04T13:43:41","slug":"python-on-raspberry-pi","status":"publish","type":"post","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/2015\/11\/04\/python-on-raspberry-pi\/","title":{"rendered":"Python on Raspberry Pi"},"content":{"rendered":"<p>For a bit of a change the class were programming in Python on a Raspberry Pi.<\/p>\n<p>The program below was used to create a Gold Block in Minecraft.<\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0;line-height: 125%\">1\r\n2\r\n3\r\n4\r\n5\r\n6\r\n7\r\n8<\/pre>\n<\/td>\n<td>\n<pre style=\"margin: 0;line-height: 125%\"><span style=\"color: #008800;font-weight: bold\">from<\/span> <span style=\"color: #0e84b5;font-weight: bold\">mcpi<\/span> <span style=\"color: #0e84b5;font-weight: bold\">.<\/span> <span style=\"color: #0e84b5;font-weight: bold\">minecraft<\/span> <span style=\"color: #008800;font-weight: bold\">import<\/span> Minecraft\r\n<span style=\"color: #008800;font-weight: bold\">import<\/span> <span style=\"color: #0e84b5;font-weight: bold\">mcpi<\/span> <span style=\"color: #333333\">.<\/span> block <span style=\"color: #008800;font-weight: bold\">as<\/span> block\r\nmc <span style=\"color: #333333\">=<\/span> Minecraft <span style=\"color: #333333\">.<\/span> create ()\r\npos <span style=\"color: #333333\">=<\/span> mc<span style=\"color: #333333\">.<\/span> player <span style=\"color: #333333\">.<\/span> getPos ()\r\nx <span style=\"color: #333333\">=<\/span> pos<span style=\"color: #333333\">.<\/span>x\r\ny <span style=\"color: #333333\">=<\/span> pos<span style=\"color: #333333\">.<\/span>y\r\nz <span style=\"color: #333333\">=<\/span> pos<span style=\"color: #333333\">.<\/span>z\r\nmc<span style=\"color: #333333\">.<\/span> setBlock (x, y, z, block <span style=\"color: #333333\">.<\/span> GOLD_BLOCK <span style=\"color: #333333\">.<\/span>id)\r\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>Created using http:\/\/hilite.me\/ and http:\/\/www.geocraft.org.uk\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a bit of a change the class were programming in Python on a Raspberry Pi. The program below was used to create a Gold Block in Minecraft. 1 2 3 4 5 6 7 8 from mcpi . minecraft import Minecraft import mcpi . block as block mc = Minecraft . create () pos &hellip;<\/p>\n","protected":false},"author":32,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[319,17009,979],"tags":[125715,125732],"class_list":["post-933","post","type-post","status-publish","format-standard","hentry","category-oldhigher","category-software-design-devlopment","category-testing","tag-python","tag-raspberry-pi"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/933","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/users\/32"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/comments?post=933"}],"version-history":[{"count":1,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":934,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/posts\/933\/revisions\/934"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/media?parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/categories?post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/ColtnessHS-ComputingScience\/wp-json\/wp\/v2\/tags?post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}