Skip to content

Commit 45fcb59

Browse files
Merge pull request #87 from microbit-sam/1.1.2-clean
Python Editor changes 1.1.2
2 parents 4f44256 + 61f2f1e commit 45fcb59

File tree

5 files changed

+21735
-21697
lines changed

5 files changed

+21735
-21697
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
1.1.2
2+
-----
3+
4+
* Updated MicroPython to 1.0.1 release
5+
* Updated README with migration documentation
6+
17
1.1.1
28
-----
39

README.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,29 @@ relatively small when you consider:
136136
* The web has caching built in (we should trust it)
137137
* We actually want kids to view source and find the .hex file in as raw a form as possible.
138138

139+
Importing Projects
140+
++++++++++++++++++
141+
Python projects from external sources can be imported into the editor using a special URL e.g.
142+
``https://python.microbit.org/v/1.1#project:{{ encoded project }}``
143+
144+
To encode a project, it must be structured as follows:
145+
146+
::
147+
148+
{
149+
meta: {
150+
cloudId: "microbit.co.uk", # optional
151+
comment: "A MicroPython script", # required - may be blank
152+
editor: "python", # required - editor name
153+
lastUse: 1538407830, # optional - UNIX time the script was last used
154+
name: "unearthly script 2" # required - may be blank
155+
},
156+
source: "# Add your Python code here. E.g.\r\n from microbit import *\r\n while True:\r\n display.scroll('Hello, World!')\r\nsleep(2000)"
157+
}
158+
159+
This JSON structure is compressed using `LZMA
160+
<https://github.com/LZMA-JS/LZMA-JS>`_, and then encoded as Base64 to include in the import URL.
161+
139162
Configuration
140163
-------------
141164

0 commit comments

Comments
 (0)