[Microbit-Python] Non volatile storage

Piggott BRUCE brucepiggott at ntlworld.com
Sat Oct 22 11:52:53 EDT 2016


Thanks for that but I have already tried that and it does not work.

I copied the example and tried it:


# test of non volatile storage

from microbit import *

with open('story.txt') as my_file:
content = my_file.read()
print(content)

I get line 5 attribute error, etc


Try it yourself.

I have been trying to solve this for 3 days now!

This for the BBC micro:bit using micropython

Cheers, Bruce


> 
>     On 22 October 2016 at 16:24 "Nicholas H.Tollervey" <ntoll at ntoll.org>
> wrote:
> 
> 
>     It's all in the documentation here:
> 
> 
>    https://microbit-micropython.readthedocs.io/en/latest/tutorials/storage.html
> 
>     Hope this helps,
> 
>     N.
> 
>     On 22/10/16 15:54, Piggott BRUCE wrote:
>     > Hi Guys.
>     >
>     > I'm having a problem finding the correct instruction for storing non
>     > volatile data in the microbit module.
>     >
>     > I need to store a variable collected during run time that is available
>     > on next power up.
>     >
>     > I know I need to create a file of some sort and/ /have searched the web
>     > for how to do this but everything I have found does not work.
>     >
>     > Can anybody give me a simple example of how to create a file of data
>     > that is available after a subsequent power up?
>     >
>     > Cheers, Bruce
>     >
>     >
>     >
>     > _______________________________________________
>     > Microbit mailing list
>     > Microbit at python.org
>     > https://mail.python.org/mailman/listinfo/microbit
>     >
> 
> 
>     _______________________________________________
>     Microbit mailing list
>     Microbit at python.org
>     https://mail.python.org/mailman/listinfo/microbit
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/microbit/attachments/20161022/141c3b72/attachment-0001.html>


More information about the Microbit mailing list