I wrapped a library using ctypes but the library is getting extensive and I would like to make it into a module so I can just type import my_moule into the python console. I've saved the file in this location :C:\Users\name.ipython\extensions\my_module.py but when I try to import it into the python console I get "ModuleNotFoundError: no module named 'my_module' "
also while searching for an answer before posting this question I noticed most modules have somethings that looks like this:
class Name(Type):
def __init__(self):
do I need to further define my structure?
My question is this: am I saving the module to the right tlocation?
a shortened version of my module looks like this, I have about 10 more structures and they are much longer.:
import ctypes
from ctypes import *
MF = (b'path_to_file')
# Wrapping the library
class TTag(Structure):
_fields_ = [
('SecondsMillie', ctypes.c_ulong),
('SecondsMicro', ctypes.c_ushort)]
class Event(Structure):
_fields_ = [
('count', ctypes.c_int),
('name', ctypes.c_char_p)]
class Header(Structure):
_fields_ = [
('fileSig', ctypes.c_ulong),
('refTime[6]', ctypes.c_ulong * 6)]