Python3Script Xojo Plugin |

# Python3XojoModule.ModuleCreateProc Method (console safe)

A function to create a value to return in a ModuleInit handler.

ModuleCreateProc() as Ptr

#### Parameters

#### Returns

Ptr

#### Remarks

DO NOT USE THIS FUNCTION FROM OTHER PLACES THAN MODULE INIT !!
Example:

If not Python3Script.PythonIsFound() then
MsgBox "Correct Python installation was not found on this machine"
Quit()
else
// We register the module to Python
Python3Script.RegisterXojoModule(xojoModule, AddressOf XojoFunctionsForPython.ModuleInit)
// Init the Python engine
Python3Script.Init("TestApp")
end if
Where the ModuleInit function will have code like this here:
Function ModuleInit() As Ptr
// You get this callback when the PythonModule is actually created for this first time.
// This is needed because Python 3.x is very differently wired and doing this internally was not possible.
// DO NOT RETURN ANYTHING HERE EXCEPT JUST WHAT THE MODULECREATEPROC FUNCTION RETURNS
return ModuleHandle.ModuleCreateProc()
End Function

#### See Also

Python3XojoModule Class