forked from peircej/python-egi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_simple_distilled.py
More file actions
40 lines (22 loc) · 830 Bytes
/
Copy pathexample_simple_distilled.py
File metadata and controls
40 lines (22 loc) · 830 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
39
40
# >>> import and initialization >>>
import egi.simple as egi
## import egi.threaded as egi
# ms_localtime = egi.egi_internal.ms_localtime
ms_localtime = egi.ms_localtime
ns = egi.Netstation()
ns.connect('11.0.0.42', 55513) # sample address and port -- change according to your network settings
## ns.initialize('11.0.0.42', 55513)
ns.BeginSession()
ns.sync()
ns.StartRecording()
# >>> send many events here >>>
## # optionally can perform additional synchronization
## ns.sync()
ns.send_event( 'evt_', label="event", timestamp=egi.ms_localtime(), table = {'fld1' : 123, 'fld2' : "abc", 'fld3' : 0.042} )
# >>> we have sent all we wanted, time to go home >>>
ns.StopRecording()
ns.EndSession()
ns.disconnect()
## ns.EndSession()
## ns.finalize()
# >>> that's it !