-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpymain.py
27 lines (21 loc) · 801 Bytes
/
pymain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#First let's add a few packages, that we will need
import ctypes
import os
import sys
import numpy as np
import threading
import time
from ctypes import *
filename = "/Users/karthik/Documents/GenHap/UH_Multithread/build/libuhdriver.so"
lib = ctypes.cdll.LoadLibrary(filename)
alter_me = lib.alter_me
alter_me.argtypes = c_char_p,c_size_t
alter_me.restype = None
data = create_string_buffer(b'/Users/karthik/Documents/GenHap/UH_Multithread/build/lineseven4_8_100hz_0005s.csv' ,size=200)
alter_me(data,sizeof(data))
lib.csvfile()
# # The array will run in a thread in the background, waiting for the rest of our instrunctions
thread = threading.Thread(target=lib.main, args=()) #create said thread
thread.daemon = True # Daemonize thread
thread.start() # Start the execution
time.sleep(120)