There's not enough information here to give you the complete answer, but the basic problem is almost certainly that helloClass.py does not end up anywhere on the module search path, so PyImport_Import can't find it.
For example, maybe you're building your main executable into a location like ~/Library/Developer/Xcode/DerivedData/Hello/Build/Products/Release/hello, but not copying helloClass.py there. Or, maybe you are copying it there, but the equivalent of dirname $0 isn't on your module path. Or… well, there are a million possibilities, but the answer is the same in every case:
Figure out where the executable and the Python file are getting installed to.
Build an appropriate (probably relative) path out of that knowledge.
Make sure that path gets added to the module path.
The exact details on how Python searches for modules is different between different versions, but the basic idea is explained in The importstatement (or the 3.3 version, which defers to The import system), and often, it's just a matter of adding something to sys.path.
(Note that if you're building .app bundles instead of just Unix command-line executables, there is a standard answer to this—you stick the .py files in a standard place, use Cocoa or CoreFoundation APIs to get the path, and then use that. But that doesn't seem to be relevant here.)
Looking at the project you uploaded at https://github.com/Eduardof0nt/help.git:
You're not copying helloClass.py anywhere. You have to decide where you want to copy it, and that depends entirely on how you want to deploy things. But for debugging purposes, just to get something testable, you can just put it alongside the Hello Python! executable (in build/Debug or build/Release). To do that:
- Select the project in the Project Navigator.
- Select the target in the left sidebar of the project view that appears.
- Select the Build Phases tab.
- Click the Add Build Phase button.
- Add a Copy Files phase.
- Set its Destination to Products Directory.
- Drag
helloClass.py from the Project Navigator into the build phase.
Now, when you build, if you look at the output (turn on "All" and "All Messages"), you'll see "Copy build/Debug/helloClass.py" right after the "Link build/Debug/Hello Python!". And, if you look inside that directory, you'll see the two files side by side.
But that doesn't solve your whole problem. Because /wherever/you/started/build/Debug is not going to be on the sys.path that Python uses. The quickest way around this is to call Py_SetProgramName(argv[0]) right before the Py_Initialize(), and PySys_SetArgvEx(argc, argv, 1) right after. That may well not be the right thing to do for your use case, but you're going to have the read the documentation and understand what all of this does, because I can't possibly explain all the details of embedding Python in an SO answer.
While you're trying to learn this stuff, you probably want to do some debugging. For example, you can printf(path=%s\n", Py_GetPath()) to see what the sys.path equivalent is, and PyObject_Print(mod, stdout, 0) to see what's in mod, and so on. But really, you're going to want to use the Xcode debugger—add a breakpoint and try doing this stuff at runtime.
Much of this is explained in Extending and Emnbedding the Python Interpreter, and you really do need to read that; there's no substitute. (You don't need to read the whole Python/C API Reference Manual, but you will end up reading a lot of it, and getting good at searching it, before you're done.) However, because embedding Python is much less common than extending it, the docs really don't include everything you need, so… if whatever tutorial you're using doesn't cover things like PySys_* and Py_GetPath, you may need to find a better tutorial first.