Our project goal is that all code that runs in the emulator will run on a Pi without modification and with identical results. Please post the code of any incompatibilities you discover here and we'll look in to it. You may find gist.github.com useful for posting longer code snippets.
Notes:
The SenseStick API is not (as of July 12) fully implemented. I will edit this issue (or perhaps open a new one) when it's ready for testing and @davidhoness will provide instructions for pulling in the latest sense_hat module version with the new API.
Most 3rd party modules (ie. anything you pip install) will not be available. Some of Python's stdlib is not available, but ~80%, including time, datetime, random, math, etc. are available. Additionally, some of numpy is implemented.
Trinket uses a Python compatibility mode that blurs the line between Python 2 and 3 so that students can use either without errors. Users can force Python 2 with a #!/usr/bin/python2 comment at the top of the trinket. Similarly, users can force Python 3 with a #!/usr/bin/python3 comment at the top of the trinket. These should also force the respective version of python if programs are downloaded and run as scripts on Linux.
Code can be easily downloaded via the Download button available in the left hand menu of any trinket. This can make testing easier (but copying and pasting code will work too)
Our project goal is that all code that runs in the emulator will run on a Pi without modification and with identical results. Please post the code of any incompatibilities you discover here and we'll look in to it. You may find gist.github.com useful for posting longer code snippets.
Notes:
sense_hat
module version with the new API.pip install
) will not be available. Some of Python'sstdlib
is not available, but ~80%, includingtime
,datetime
,random
,math
, etc. are available. Additionally, some ofnumpy
is implemented.#!/usr/bin/python2
comment at the top of the trinket. Similarly, users can force Python 3 with a#!/usr/bin/python3
comment at the top of the trinket. These should also force the respective version of python if programs are downloaded and run as scripts on Linux.