码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
使用c语言调用python小结
最近在做一个漏洞展示平台,攻击实现部分使用python实现,c语言实现部分使用libcli库做一个类似telnet的东东,回调函数run的时候调用python模块。针对c调用python,做个了小demo python模块:demo.py def print_arg(str): print str def add(a,b): print 'a=', a print...
分类:编程语言   时间:2014-11-15 00:15:46    阅读次数:311
STL全排列算法next_permutation和prev_permutation
全排列的问题取决于如何找到“下一个”,然后就用同样的方法找到全部的排列 下面只利用next_permutation从“第一个”开始,修改内容到“下一个”,知道所有的都遍历完,不再有”下一个“为止 #include #include #include #include using namespace std; template void print(T begin,T end) {...
分类:编程语言   时间:2014-11-14 22:52:57    阅读次数:189
Python学习笔记(七)函数的使用
python中的函数使用较简单,这里列出值得注意的几点: 内嵌函数 例如: # coding: utf-8 def foo(): def bar(): print 'bar() called.' print 'foo() called.' foo() bar() 对bar的调用是非法的,因为bar的...
分类:编程语言   时间:2014-11-14 22:25:50    阅读次数:326
Python的一些小技巧
#coding:utf-8#数据交换x = 6y = 5 x, y = y, xprint xprint y#相当于:?print "hello" if False else "world"#一种方式绑定不同类型的数据 nfc = ["Packers", "49ers"]afc = ["Ravens...
分类:编程语言   时间:2014-11-14 22:24:52    阅读次数:323
python---对齐
print '0123'.ljust(20, '-')print '01234'.ljust(20, '-')print '012356'.ljust(20, '-')print '0123567'.ljust(20, '-')
分类:编程语言   时间:2014-11-14 22:19:44    阅读次数:204
OE - 报表RML格式详解
OE - 报表RML格式详解 <?xml?version="1.0"?encoding="utf-8"?> <document??filename="report.oecn_training_lesson.pdf"?compression="1"> ??{{script}}import?datetime;print?datetime.datetime.now;{...
分类:其他好文   时间:2014-11-14 18:10:13    阅读次数:171
Font Awesome 4.2.0 Icon
fa-开头的代表图标的文本 参考官网 http://fortawesome.github.io/Font-Awesome/cheatsheet/ Print this page to PDF for the complete set of vectors. Or to use on the desktop, install FontAwesome.otf, set it as...
分类:其他好文   时间:2014-11-14 17:56:07    阅读次数:2213
插入数据库insert,记录下封装时使用的方法
今天感谢oschina的网友解答,把自己想了很久的问题解决了(对于一些资深的phper来说很简单的问题)T_T 封装的sql语法函数。 把他分解一遍,收获不少 //简单分解,每一次print_r,就知道为什么要这么做了 //获取的...
分类:数据库   时间:2014-11-14 16:00:54    阅读次数:187
lua 函数回调技巧
技巧1:local a = {}; function b() print("Hello World") end a["sell"] = {callFunc =b} a["sell"].callFunc()技巧2:    使用lua 自带的 unpack :    解释:把一直数组(只有连续数字下标的 table)展开成一串返回值,但是对用字符串或别的东西做 key 的 table 无能为力。fu...
分类:其他好文   时间:2014-11-14 15:43:30    阅读次数:136
python 产生随机数,随机字符串
import randomimport string#随机整数:print random.randint(1,50)#随机选取0到100间的偶数:print random.randrange(0, 101, 2)#随机浮点数:print random.random()print random.uni...
分类:编程语言   时间:2014-11-14 15:32:00    阅读次数:178
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!