Hello,
I've been experimenting with your code at:
https://code.google.com/p/python-on-a-chip/
I would like to use it to run scripts in an embedded CPU environment
where the python scripts are uploaded to the device via ethernet.
The device does not have a file system,
so I need the ascii script to load from memory into
the pymite interpreter and run.
At various times other scripts will be loaded onto the device and also need
to run.
Here below is what I need to function in its simplest form,
however the function 'pm_run' assumes the passed in string
is a tag to an image made by 'pmImgCreator', which is not the situation I
have.
Can this be done? It seems it should, but I am struggling finding the right
pymite API.
Let me know of a way to accomplish what I need.
Any help would greatly be appreciated.
Thanks
-
#include "pm.h"
int main(void)
{
const char* script = "for letter in 'Python': print 'Current Letter :',
letter";
PmReturn_t retval;
retval = pm_init(MEMSPACE_PROG, C_NULL);
if (retval == PM_RET_OK)
{
retval = pm_run((uint8_t *)script);
}
return (int)retval;
}