AlineIoste commited on
Commit
2ed3649
·
verified ·
1 Parent(s): dc736f9

Rename app_install.py to app.py

Browse files
Files changed (1) hide show
  1. app_install.py → app.py +43 -0
app_install.py → app.py RENAMED
@@ -32,3 +32,46 @@ if os.path.exists(output_path):
32
  st.write("File downloaded successfully.")
33
  else:
34
  st.write("Failed to download the file.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  st.write("File downloaded successfully.")
33
  else:
34
  st.write("Failed to download the file.")
35
+
36
+ # Listar símbolos da biblioteca
37
+ import list_symbols
38
+ symbols = list_symbols.list_symbols(output_path)
39
+ st.write("Symbols in the library:")
40
+ st.write(symbols)
41
+
42
+ # Carregar a biblioteca compartilhada usando ctypes
43
+ try:
44
+ lib = ctypes.CDLL(output_path)
45
+
46
+ # Verificar e definir as funções
47
+ if hasattr(lib, 'Initial_Memory'):
48
+ Initial_Memory = lib.Initial_Memory
49
+ Initial_Memory.argtypes = [ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p]
50
+ Initial_Memory.restype = ctypes.c_void_p
51
+ st.write("Initial_Memory function loaded successfully.")
52
+ else:
53
+ st.write("Initial_Memory function not found in the library.")
54
+
55
+ if hasattr(lib, 'Synapses_Active'):
56
+ Synapses_Active = lib.Synapses_Active
57
+ Synapses_Active.argtypes = [ctypes.c_char_p, ctypes.c_void_p]
58
+ Synapses_Active.restype = ctypes.c_void_p
59
+ st.write("Synapses_Active function loaded successfully.")
60
+ else:
61
+ st.write("Synapses_Active function not found in the library.")
62
+
63
+ if hasattr(lib, 'ExecuteModel'):
64
+ ExecuteModel = lib.ExecuteModel
65
+ ExecuteModel.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_int, ctypes.c_char_p, ctypes.c_void_p]
66
+ ExecuteModel.restype = ctypes.c_char_p
67
+ st.write("ExecuteModel function loaded successfully.")
68
+ else:
69
+ st.write("ExecuteModel function not found in the library.")
70
+ except Exception as e:
71
+ st.write(f"Error loading library: {e}")
72
+
73
+ # Continue com o restante da lógica do seu aplicativo Streamlit
74
+
75
+ import keys as key
76
+
77
+ st.title("Neurocognitive Structures")