- 博客(7)
- 收藏
- 关注
原创 erlang调用c\c++动态链接库
之前的服务器用c++写的,有一个加密库一要在erlang中使用,正好来了解一下erlang nif模块下面是简单的例子。 1、vs新建一个空白的c++工程名字就叫niftest 2、把ERL_ROOT/usr/include目录复制到niftest工程目录里 3、右键项目属性-》常规-》配置类型-》动态库(.dll) 4、右键项目属性-》常规-》字符集-》使用Unicode字符集 5、右键
2017-09-10 18:41:48
2009
原创 Python模块学习--property
# -*- coding: utf-8 -*-#创建一个学生类,基本属性id、姓名、年龄class Student(object): def __init__(self,stuId,stuName,stuAge): self.stuId = stuId self.stuName = stuName self.stuAge = stuAg
2014-09-28 17:30:52
349
转载 Python模块学习 ---- struct处理二进制
有的时候需要用python处理二进制数据,比如,存取文件,socket操作时.这时候,可以使用python的struct模块来完成.可以用 struct来处理c语言中的结构体.
2014-09-15 15:29:58
1722
原创 Python模块学习 ---- zlib 数据压缩
Python标准模块中,有多个模块用于数据的压缩与解压缩,如zipfile,gzip, bz2等等。上次介绍了zipfile模块,今天就来讲讲zlib模块。zlib.compress(string[, level])zlib.decompress(string[, wbits[, bufsize]])
2014-09-12 16:30:24
602
原创 拒绝连接
#coding=UTF-8'''Created on 2014年9月1日@author: Administrator'''# 这个例子只运行了反应器(reactor)。所以什么也不会发生。# 它几乎不会耗费任何处理器(cpu)资源。也许没什么用,不过这是Twisted程序成长的骨架。from twisted.internet import reactorreactor.run()
2014-09-03 16:20:28
459
原创 Python的Twisted框架入门
#coding=UTF-8from twisted.internet import reactordef main(): print 'Running reactor' reactor.run()#调用run函数则启动事件循环 print 'Reactor stopped'if __name__=='__main__': main()最简单的
2014-08-12 17:32:01
512
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人