Switch to unified view

a b/python/example_export_encrypted.py
1
# This is an example of popping a packet from the Emotiv class's packet queue
2
# Additionally, exports the data to a CSV file.
3
# You don't actually need to dequeue packets, although after some time allocation lag may occur if you don't.
4
5
6
import platform
7
8
import time
9
from emokit.emotiv import Emotiv
10
11
if platform.system() == "Windows":
12
    pass
13
14
if __name__ == "__main__":
15
    with Emotiv(display_output=True, verbose=True, write=True, write_encrypted=True) as headset:
16
        print("Serial Number: %s" % headset.serial_number)
17
        print("Exporting data... press control+c to stop.")
18
19
        while headset.running:
20
            try:
21
                packet = headset.dequeue()
22
            except Exception:
23
                headset.stop()
24
            time.sleep(0.001)