for a robotic project I build a python framework consisting of several files. The files implement the robots behaviour, mainly line following and sensing colors. When I upload these files and run the code everything works fine.
Since the framework is a work-in-progress framework we every once in a while need to provide an update for the framework. So we wrote a script that concatenates all python files into one large file and removes redundant imports. This time the import fails with a memory error:
Code: Select all
>>> from mybot import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError:
Code: Select all
>>> from mybot import MyBot
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
MemoryError: memory allocation failed, allocating %u bytes
Can somebody please explain to me whe memory allocation fails for one large file but not for several small ones (having the same content)?
Kind regards
Christian