![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
嵌入式
hanyingzhong
这个作者很懒,什么都没留下…
展开
-
一种C语言同步代码封装方法
#include "stdio.h"#include <stdarg.h>void SetMeasurementParameter(unsigned int SampleCount, unsigned int SampleInteval,...) { printf("%d %d\r\n", SampleCount, SampleInteval);}void SetMeasurementParameter2(int co.原创 2022-03-24 13:54:01 · 896 阅读 · 0 评论 -
python:cmd+zeromq
#https://blog.51cto.com/capricorn/1891402# coding=utf-8from cmd import *import sysfrom subreqnode import SubReqNodefrom multiprocessing import Queue, Processdef subscribe_callback(node): string = node.sub_socket.recv_string() print('{}'.f.原创 2022-01-26 16:55:30 · 778 阅读 · 0 评论 -
python cmd模块
# coding=utf-8from cmd import *import sysclass TestCmd(Cmd): def __init__(self): Cmd.__init__(self) Cmd.intro="测试用的模块" def do_test1(self,line): print "test模块下的test命令" def help_test1(self): print "用于测试这个模块" .原创 2022-01-25 15:11:01 · 860 阅读 · 0 评论 -
python/sub/pub/rep/req
[root@han node]# cat pubrepnode.py import zmqimport timea = 0def rep(node): global a print('------------') time.sleep(1) a = a+1 node.pub_socket.send_string("%s %s" % ('onu/online', str(a)))class PubRepNode(object): def __i.原创 2022-01-24 20:26:43 · 789 阅读 · 0 评论 -
python/timer
import timefrom multiprocessing import Queue, Processclass TimerMgr(object): def __init__(self, TotalTimers): self.totalTimers = TotalTimers self.idleTimers = ['timer'+str(y) for y in range(TotalTimers)] print(self.idleTimers) a =.原创 2022-01-21 13:07:49 · 758 阅读 · 0 评论 -
python/Queue/timeout
from multiprocessing import Queue, Processdef producer(q): q.put('send a message')def consumer(q): while True: try: item = q.get(timeout=0.1) print(item) except Exception as error: passif __name__ == '__main__': .原创 2022-01-21 09:44:50 · 512 阅读 · 0 评论 -
python:获取嵌套字典值
[root@han learn_python]# vi getdictvalue.py def getdictvalue(d,code): result=[] if isinstance(d, dict) : try: value = d[code] result.append(value) except Exception as e: pass for value.原创 2022-01-19 16:05:31 · 927 阅读 · 0 评论 -
Linux /dev/mem的新玩法
来自《解决Linux内核问题实用技巧之-dev/mem的新玩法》Linux /dev/mem的新玩法_Netfilter,iptables/OpenVPN/TCP guard:-(-CSDN博客Linux /dev/mem的新玩法_Netfilter,iptables/OpenVPN/TCP guard:-(-CSDN博客/dev/mem里有什么简单来讲,/dev/mem是系统物理内存的映像文件,然而这里的 “物理内存” 需要进一步解释。物理内存是指我们插在内存槽上的内存条吗?当然是,但物理内存不单原创 2022-01-01 21:48:56 · 628 阅读 · 0 评论