Skip to content

Python Editor changes 1.1.2 #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
1.1.2
-----

* Updated MicroPython to 1.0.1 release
* Updated README with migration documentation

1.1.1
-----

Expand Down
23 changes: 23 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,29 @@ relatively small when you consider:
* The web has caching built in (we should trust it)
* We actually want kids to view source and find the .hex file in as raw a form as possible.

Importing Projects
++++++++++++++++++
Python projects from external sources can be imported into the editor using a special URL e.g.
``https://python.microbit.org/v/1.1#project:{{ encoded project }}``

To encode a project, it must be structured as follows:

::

{
meta: {
cloudId: "microbit.co.uk", # optional
comment: "A MicroPython script", # required - may be blank
editor: "python", # required - editor name
lastUse: 1538407830, # optional - UNIX time the script was last used
name: "unearthly script 2" # required - may be blank
},
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)"
}

This JSON structure is compressed using `LZMA
<https://github.com/LZMA-JS/LZMA-JS>`_, and then encoded as Base64 to include in the import URL.

Configuration
-------------

Expand Down
Loading