コード例 #1
0
ファイル: leds.py プロジェクト: Ile2/elovalo
def generate_leds(mat='led_off'):
    prefix = 'led'
    n = 8
    s = 0.01
    r = [i / (n - 1) for i in range(n)]

    for i, axes in enumerate(itertools.product(r, r, r)):
        o = cube()
        o.name = prefix + '_' + str(i)
        o.location = axes
        o.scale = (s, s, s)
        o.show_transparent = True

        o.active_material = duplicate(mat)
コード例 #2
0
def ListProcesses():
    result = []
    hProcessSnap = c_void_p(0)
    hProcessSnap = CREATETOOLHELP_32_SNAPSHOT(TH32CS_CLASS.SNAPPROCESS, 0)

    pe32 = ProcessEntry32()
    pe32.dwSize = sizeof(ProcessEntry32)
    ret = PROCESS_32_FIRST(hProcessSnap, pointer(pe32))

    while ret:
        result.append(duplicate(pe32))
        ret = PROCESS_32_NEXT(hProcessSnap, pointer(pe32))

    CLOSE_HANDLE(hProcessSnap)
    return result
コード例 #3
0
def ListProcesses():
        result = []
        hProcessSnap = c_void_p(0)
        hProcessSnap = CREATETOOLHELP_32_SNAPSHOT( TH32CS_CLASS.SNAPPROCESS , 0 )


        pe32 = PROCESSENTRY32()
        pe32.dwSize = sizeof( PROCESSENTRY32 )
        ret = PROCESS_32_FIRST( hProcessSnap , pointer( pe32 ) )

        while ret :
                result.append(duplicate(pe32))
                ret = PROCESS_32_NEXT( hProcessSnap, pointer(pe32) )

        CLOSE_HANDLE(hProcessSnap)
        return result
コード例 #4
0
def ListProcessModules( ProcessID ):
        result = []
        hModuleSnap = c_void_p(0)
        me32 = MODULEENTRY32()
        me32.dwSize = sizeof( MODULEENTRY32 )
        hModuleSnap = CREATETOOLHELP_32_SNAPSHOT( TH32CS_CLASS.SNAPMODULE, ProcessID )

        ret = MODULE_32_FIRST( hModuleSnap, pointer(me32) )
        if ret == 0 :
                errmsg =  'ListProcessModules() Error on Module32First[%d]' % GET_LAST_ERROR()
                print errmsg
                CLOSE_HANDLE( hModuleSnap )

        while ret :
                result.append(duplicate(me32))

                ret = MODULE_32_NEXT( hModuleSnap , pointer(me32) )

        CLOSE_HANDLE( hModuleSnap )
        return result
コード例 #5
0
def ListProcessThreads( ProcessID ):
        result = []
        hThreadSnap = c_void_p(0)
        te32 = THREADENTRY32 ()
        te32.dwSize = sizeof(THREADENTRY32 )

        hThreadSnap = CREATETOOLHELP_32_SNAPSHOT( TH32CS_CLASS.SNAPTHREAD, 0 )

        ret = THREAD_32_FIRST( hThreadSnap, pointer(te32) )

        if ret == 0 :
                errmsg = 'ListProcessThreads() Error on Thread32First[%d]' % GET_LAST_ERROR()
                CLOSE_HANDLE( hThreadSnap )

        while ret :
                if te32.th32OwnerProcessID == ProcessID :
                        result.append(duplicate(te32))

                ret = THREAD_32_NEXT( hThreadSnap, pointer(te32) )

        CLOSE_HANDLE( hThreadSnap )
        return result