Python suitability questions

Martijn Faassen m.faassen at vet.uu.nl
Tue Jul 20 13:06:01 EDT 1999


Jason Maskell <jmaskell at saskpublishers.sk.ca> wrote:
[snip]
> and the scripting language has to be comfortable being completely
> embedded in my C++ framework,

There are various ways to integrate Python with C or C++ code. You can
hand code things of course, and I've heard Python's extending/embedding
API is quite nice. You can also use various tools for it. SWIG is very
handy, having toyed with it myself (www.swig.org).

There are many people on this newsgroup who have far more experience with
extending and embedding Python than I do, though, so let's wait and see
what they'll say :)

> and having really no system access at all.

Look into the 'rexec' and 'Bastion' modules in the Python library reference.
 
> I know that Python can handle the OO stuff,
> but is there any kind of internal
> object messaging, or do I roll my own?

What do you mean by an 'internal object messaging'? What I do know that if
you decide to roll your own you'll be fine with Python -- it's very dynamic
that way.

> How flexible can I lay out my source,
> is it as stiff as say, C?

This depends on what you mean. Python uses whitespace to indicate block
structure, so you could see that as 'strict' (though not actually more
strict than begin and end markers; just different). Once you're used to
it it's very handy; you start to wonder why other languages have these
annoying { and } characters (or whatever they may be using).

Due to Python's dynamic nature, it's very easy to change the layout of
your code, though. In C++ I get lost in endless designing of classes,
in Python I just write down what I want. :)

Of course I don't want to say solid design of classes isn't necessary; it's
still good to do.
 
Good luck!

Regards,

Martijn





More information about the Python-list mailing list