The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
[Originally posted by tuhtah]

Shouldn't be

void example1_init() {
Py_InitModule("example1", example1_methods);

on page 272 be more like:

void initexample1() {
Py_InitModule("example1", example1_methods);

It worked for me this way because otherwise the interpreter complains like this:
>>> import example1
Traceback (innermost last):
File "<stdin>", line 1, in ?
ImportError: dynamic module does not define init function (initexample1)

This should then be analogous for the definitions on page 274, 275, 277 or did
I miss the point?

I am on a Linux box.