Extended functions in embedded code

Chris Angelico rosuav at gmail.com
Tue Oct 13 11:05:43 EDT 2015


On Wed, Oct 14, 2015 at 1:59 AM, Ervin Hegedüs <airween at gmail.com> wrote:
> no, I have filesystem. I help to contribute a software, which had
> written in C. The configuration schema is very simple, there are
> several keywords, but not all required function could be
> configure with them. Python would be a good choice, but the
> users aren't programmers in most cases. I just don't want to
> start the documentation, that
>
> "Make a Python script like this:
>
> import mymodul
>
> ...."
>
> and nobody knows, why is it require, because there isn't any
> module with this name.

Sounds to me like the easiest way would be to inject into the
builtins. You should be able to import the builtins module from your C
code, and then stuff some extra attributes into it; they'll be
automatically available to the script, same as the "normal" built-in
names like int, super, and ValueError.

ChrisA



More information about the Python-list mailing list