ctypes

    3熱度

    1回答

    我在Windows 8.1運行此代碼: import ctypes, time ctypes.windll.user32.keybd_event(0x12, 0, 0, 0) #Alt ctypes.windll.user32.keybd_event(0x09, 0, 0, 0) #Tab time.sleep(2) ctypes.windll.user32.keybd_event(

    1熱度

    1回答

    這與#1228158或#28879604不一樣。它是相似的,但有一個轉折點。 是微不足道的創建遞歸類型指的是其自己的類型: A = type('A', (ctypes.Structure,), {}) A._fields_ = [('another_a', ctypes.POINTER(A))] 或者,如果你喜歡: class A(ctypes.Structure): pass

    2熱度

    1回答

    我在OS X上嘗試這個boost python with cmake的例子。這篇文章有點舊,但是我找不到更新的東西。我的目標是使用CMake(因爲我使用CLion)來構建C++和Python庫的集成項目。我使用Python 2.7在OS X上 我.cpp文件是 #include <boost/python.hpp> char const* yay() { return "Yay!"

    0熱度

    1回答

    我想了解更多關於PE文件結構和ctypes結構的信息。我有幾個問題: 鑑於這種簡單的聲明: from ctypes import * class ImageDosHeader(Structure): _fields_ = [ ('e_magic', c_uint8, 2), ('e_cblp', c_uint8, 2), ('e_cp', c_ui

    1熱度

    1回答

    這就是我想: import ctypes import os drive = "F:\\" folder = "Keith's Stuff" image = "midi turmes.png" image_path = os.path.join(drive, folder, image) SPI_SETDESKWALLPAPER = 20 ctypes.windll.user32.S

    0熱度

    2回答

    我在定義一個DLL文件中的C函數如下: myFunction(const int a, long b, void * data, unsigned int * c, unsigned int * d, unsigned long * timestamp) 參數: [in]: a [in]: b [out]: data, which is a pointer to a buffer that

    0熱度

    1回答

    我試圖在窗口上用鍵盤按住鍵盤按鍵。我可以模擬但不能握住鑰匙。我嘗試過ctypes,AHK,Sendkeys,但都沒有工作。是否有任何方法可以按住鍵盤按鍵,直至發佈呼叫。任何暗示是讚賞。 在此先感謝

    0熱度

    1回答

    我正在做我的簡單C++物理仿真和可視化庫到Python的接口。我想在互動的方式來使用它 - 意爲通過調用Python函數解釋參數調整參數,而模擬/可視化運行) 目前non-interactive scrip看起來是這樣的: import numpy as np import pyVis3D as vis # inititalization vis.lib.initWindow() #

    3熱度

    1回答

    我在Python 2.7,字符串數組的一個數組,我想通過​​傳遞給一個C函數: unsigned int SetParams(unsigned int count, const char **params) 因此,我可以限定在python的參數: import ctypes as ct lib = ct.cdll.LoadLibrary('...') lib.SetParams.resty

    0熱度

    1回答

    如何將3D python數組傳遞給C代碼然後返回? 我研究, Pass a 2d numpy array to c using ctypes 我已經嘗試了2D 來源: - http://cboard.cprogramming.com/c-programming/61578-4-dimensional-array-contiguous-allocation.html#post438210 test1