Embedding Python the extreme way
Michael Hudson
mwh at python.net
Wed Jul 10 09:29:52 EDT 2002
Wolfgang Draxinger <wdraxinger at darkstargames.de> writes:
> Michael Hudson wrote:
>
> > To me these sentences contradict each other. So I must be missing
> > something...
>
> I want not to add a statically linkes python.lib to my linkage
Why not? Do you mean you don't want to use the distributed python.lib?
> > For the modules, just don't build them. You really don't want to try
> > getting rid of sys, btw.
>
> Yes I want that!
No, you don't: far too much of the internals depends on getting things
out of the sys module. You might be able to hide things from the
scripts that you execute, but that's a different problem, surely?
> I just want the language and the grammar and basic data
> types. E.g. I've a virtual file system in my engine. All that's
> related to files should go through this natively.
> Ok, discarding sys may be not a good idea, but things like
> sys.exit, sys.path, sys.dllhandle and similair should definitely not
> be touched by engine object scripts.
OK, so I think a better (read: easier) strategy might be to /hide/
these objects, not /remove/ them.
> >>Can anybody give me some advice for that.
> > Yes: don't.
>
> Why?
Because there are probably easier ways of acheiving what you want;
executing "engine object scripts" is a heavily custimized environment
is almost certain to be more straightforward than heavily customizing
the interpreter, and sounds to me as if it will do the job.
Cheers,
M.
--
The ability to quote is a serviceable substitute for wit.
-- W. Somerset Maugham
More information about the Python-list
mailing list