passing array of data to host computer

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: passing array of data to host computer

Post by dhylands » Sun Jan 30, 2022 4:12 am

You can find the most recent pyboard.py in the micropython tools directory:
https://github.com/micropython/micropyt ... pyboard.py

ryanGT
Posts: 24
Joined: Fri Jan 28, 2022 12:15 am

Re: passing array of data to host computer

Post by ryanGT » Sun Jan 30, 2022 4:56 am

Thanks for your response.

But what is the proper way to do something like execfile from rshell? How do I send a command from rshell to tell the pyboard to exectute a file?

ryanGT
Posts: 24
Joined: Fri Jan 28, 2022 12:15 am

Re: passing array of data to host computer

Post by ryanGT » Sun Jan 30, 2022 5:04 am

What I mean is that me using pyboard directly feels like I am going around rshell and re-inventing the wheel. I don't want to do that.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: passing array of data to host computer

Post by dhylands » Mon Jan 31, 2022 5:40 pm

To execute a file on the pyboard using rshell, I normally use the repl command and then import the file I want to execute from the repl.

You can combine these two into a single line command:

Code: Select all

repl ~ import hello
and that will execute /flash/hello.py on my pyboard. In my own personal workflow I edit the files on the host and use rshell to copy/test them. So I normally combine a copy command, the repl and import all on a single line:

Code: Select all

cp hello.py /flash; repl ~ import hello
then it gets stored in the history that way and I can use the up arrow to retrieve the previous command and do it all over again.

Post Reply