本文整理汇总了Python中EEGsynth.patch方法的典型用法代码示例。如果您正苦于以下问题:Python EEGsynth.patch方法的具体用法?Python EEGsynth.patch怎么用?Python EEGsynth.patch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEGsynth
的用法示例。
在下文中一共展示了EEGsynth.patch方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: import EEGsynth [as 别名]
# 或者: from EEGsynth import patch [as 别名]
parser = argparse.ArgumentParser()
parser.add_argument("-i", "--inifile", default=os.path.join(installed_folder, os.path.splitext(os.path.basename(__file__))[0] + '.ini'), help="optional name of the configuration file")
args = parser.parse_args()
config = configparser.ConfigParser(inline_comment_prefixes=('#', ';'))
config.read(args.inifile)
try:
r = redis.StrictRedis(host=config.get('redis', 'hostname'), port=config.getint('redis', 'port'), db=0)
response = r.client_list()
except redis.ConnectionError:
print("Error: cannot connect to redis server")
exit()
# combine the patching from the configuration file and Redis
patch = EEGsynth.patch(config, r)
# this determines how much debugging information gets printed
debug = patch.getint('general', 'debug')
# keep track of the number of received triggers
count = 0
class TriggerThread(threading.Thread):
def __init__(self, redischannel, rate):
threading.Thread.__init__(self)
self.redischannel = redischannel
self.rate = rate
self.key = "d%d.%s" % (rate, redischannel)
self.count = 0
self.running = True