"Robert Lummis" <robert.lum...@gmail.com> wrote
I'm looking for a way to get boiler plate code into the main program
file. Of course I could copy and paste it with an editor but I was
hoping for something more pythonic. I know about import but that's not
the same.
Others have already pointed out import.
Its also worth pointing out that #include is a pretty horrible hack in C
that most modern commentators agree would be better removed.
Bjarne Stroustrup tried very hard to remove it completely from
C++ (apart from including class headers obviously which is akin
to Pythons import). But #define and #ifdef etc are all better done
in other ways.
Pythons import mechanism with namespaces is a far more elegant
solution all round.
Alan G.
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor