有的时候需要用python处理二进制数据,比如,存取文件,socket操作时.这时候,可以使用python的struct模块来完成.可以用
struct来处理c语言中的结构体.struct模块中最重要的三个函数是pack(), unpack(), calcsize()pack(fmt, v1,
v2...
分类:
编程语言 时间:
2014-06-11 13:23:29
阅读次数:
325
Python Open Flash Chart (pyOFC2) — HomepyOFC2
Python Open Flash Chart 2
分类:
编程语言 时间:
2014-06-11 13:15:46
阅读次数:
206
拥有c背景的程序员一定熟悉传统的除法,也就是说,对整形操作数,会执行“地板除”(floor,
取比商小的最大整型)。例如5除以2等于2.5,其中“2”就称为商的地板;即“地板除”的结果;传统除法:
如果是整型除法,传统除法会舍去小数部分,返回一个整形(地板除),如果操作数之一是浮点型;则执行真...
分类:
编程语言 时间:
2014-06-11 12:34:12
阅读次数:
293
原题地址:https://oj.leetcode.com/problems/search-insert-position/题意:Given
a sorted array and a target value, return the index if the target is found. If
n...
分类:
编程语言 时间:
2014-06-11 11:28:40
阅读次数:
349
原题地址:https://oj.leetcode.com/problems/plus-one/题意:Given
a non-negative number represented as an array of digits, plus one to the
number.The digits are...
分类:
编程语言 时间:
2014-06-11 11:25:27
阅读次数:
304
原来这么长时间没写了,今天阅读《集体智慧编程》的时候,发现了python的一个功能,列表推导式。留个存[ 表达式 for 变量 in 列表] 或者[表达式
for 变量 in 列表 if 条件]例如:ll=[1,2,3,4,5,6,7,8,9,0]print (v*10 for v in ll if...
分类:
编程语言 时间:
2014-06-11 11:23:16
阅读次数:
330
1, 安装nodejs安装python。2,安装node-gyp:sudo npm
install -g
node-gyp3,写代码:新建一个目录,创建hello.cc文件,然后创建binding.gyp文件:hello.cc#include#includeusingnamespace
v8;Han...
分类:
编程语言 时间:
2014-06-11 11:10:24
阅读次数:
380
Jenkins的job->build 支持Ant,maven,windows
batch和Shell,
但是我们知道python,perl,ruby等脚本其实也是shell脚本,所以这里的Shell可以扩展为python,perl,ruby等。例如:
下面执行windows batch 和pytho...
分类:
编程语言 时间:
2014-06-11 10:03:49
阅读次数:
296
原题地址:https://oj.leetcode.com/problems/rotate-image/题意:You
are given annxn2D matrix representing an image.Rotate the image by 90 degrees
(clockwise).Fo...
分类:
编程语言 时间:
2014-06-11 09:43:59
阅读次数:
1264
学习了元祖,写了小程序。#encoding = utf-8 a =
("success","false","what")print "first"print a #print all stringprint "\n"print
"second"print a[:] #pirnt all string...
分类:
编程语言 时间:
2014-06-11 09:07:45
阅读次数:
322