Answer the question
In order to leave comments, you need to log in
What is the best way to import the ctypes module?
Hello. Here is such a template code in the module.
# fox.py
fox = ctypes.CDLL(pathdll)
fox.CloseWindow.restype = None
fox.CloseWindow.argtypes = []
# main.py
# так мне его приходится импортировать
fox.CloseWindow()
# какие есть варианты избавится от fox ? в main.py мой вариант ниже
# он не очень удобен при объемном код
# fox.py
fox = ctypes.CDLL(pathdll)
fox.CloseWindow.restype = None
fox.CloseWindow.argtypes = []
def CloseWindow():
fox.CloseWindow()
# main.py
CloseWindow()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question