Registering a python function in C

Matt McCredie mccredie at gmail.com
Tue Sep 4 18:28:20 EDT 2007


> > Is Maya a different python build than what is contained at python.org?
> > If so, I suggest you get your C program to work with the latest python
> > build
> > from python.org.  Then see if you can get it to work with the Maya
> > version.
>
> Ok, did that. If I write a normal C++ program and use the python
> installed in my system, everything works ok and I can call the python
> funtions. From within maya(where the C code is running as a plugin),
> nothing happens. I tried removing my python installation so that only
> the one that comes with maya is running, but then I have no python.h
> or libs to compile against!! I found no help at the maya/python
> newsgroup, is there anyone who has done this before???

I don't really know how maya works with python. Is it possible to just
run arbitrary python code from maya? Can you get the version strings
and stuff?

>>>import sys
>>>print sys.version

That might give you a clue. It might just be that you need to compile
against a different version of Python. You could always just download
the different versions of Python and see if the included Python.h and
Python.lib work. I would go in this order: 2.3, 2.4, 2.2, 2.5.

Matt



More information about the Python-list mailing list