django获取指定列的数据 model一般都是有多个属性的,但是很多时候我们又只需要查询特定的某一个,这个时候可以用到values和values_list [values()](https://docs.djangoproject.com/en/1.9/ref/models/querysets/#values) values()¶ values(*fields)¶ Returns a QuerySet that returns dictionaries, rather than model i
最近写C#串口通信程序,系统是B/S架构.SerialPort类有一个DataReceived事件,用来接收串口返回的数据,但这种方式在C/S架构下很好用,但B/S就不好处理了.所以写了一个同步模式接收返回数据的方法,不使用DataReceived事件.经过测试,可以正常使用. 一.MachineFactory类 为什么使用工厂类:售货机由不止一个厂家提供,接口协议都不一样. using System; using System.Collections.Generic; using System
报警器实例:(有发送,无返回获取) using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.Text.RegularExpressions; using System.Windows.Forms; namespace ZKJFJK { /*** 报警器语音输出类,只需在调用时填写需要播报汉字即可 * 例:boo