Python suitability questions

Jason Maskell jmaskell at nospam.saskpublishers.sk.ca
Tue Jul 20 18:02:18 EDT 1999


Martijn Faassen <m.faassen at vet.uu.nl> wrote in message
news:7n2a9p$trq$1 at news.accu.uu.nl...
> 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).

Ok, will take a look.

> > 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.

Ah yes, I thought I might have been unclear. Well, to use MtG for an example
once again, there is a card called manabarbs that causes 1 pt of damage to
any player who taps a land for mana. So, when the player taps a land for
mana, the land will send a message or two saying that it has been tapped,
which the dispatcher will then send to the appropriate cards, which will
then cause the damage. Thinking about it some more, I see that I will have
to write my own manager/dispatcher. Not a big hardship,  I just wasn't
thinking that clearly this morning (surprise).

> > 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

Actually, not worried so much about indents and braces and all that, just
thinking that I might have to have some ungodly source file organisation
where the cards are in one or more text files, and then one or two other
text files for various other things. I guess I'm just more interested in
whether or not I can point the interpreter to an arbitrary chunk of code and
 let it do it's thing, or what exactly is involved. I'll do some more
research. ;>

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

Ya, good OO design will be fairly essential in this project.

>
> Good luck!
>

Thanks a lot. ;>

Jason







More information about the Python-list mailing list