码迷,mamicode.com
首页 >  
搜索关键字:print    ( 43532个结果
python之self
#!/usr/bin/env Python# coding=utf-8__metaclass__ = typeclass Person: def __init__(self, name): self.name = name print self #新增 print type(se...
分类:编程语言   时间:2015-11-27 17:30:40    阅读次数:143
函数式编程
map/reduce#函数式编程的一个特点就是,允许把函数本身作为参数传入另一个函数,还允许返回一个函数#编写高阶函数,就是让函数的参数能够接收别的函数def add(x, y, f): return f(x) + f(y)print(add(-1, 1, abs))def f(x): ...
分类:其他好文   时间:2015-11-27 12:50:55    阅读次数:157
python的一些常用的标准库
一、sys这是一个用来跟python解释器交互的模块。sys.argv用来想python解释器传递参数,也叫“命令行参数”。代码如下:#coding=utf-8 importsys print"Thefilename:",sys.argv[0] print"Thenumberofarg:",len(sys.argv) print"Thrargis:",str(sys.argv)执行:python123.py123Th..
分类:编程语言   时间:2015-11-27 09:18:49    阅读次数:164
Java初识
Java的标准输入与输出:输出:System.out.print(); System.out.println(); //多打印了一个回车 System.out.println("小刘刘"); System.out.println("小王王"); 输入:import java.u...
分类:编程语言   时间:2015-11-26 23:17:21    阅读次数:176
U3D Trigger事件触发
使用Trigger事件触发,可以达到虽然触发了,可是不改变任何效果。这个是进入时候触发的: void OnTriggerEnter2D(Collider2D other) { print (other.transform.name); }退出触发: void OnTr...
分类:其他好文   时间:2015-11-26 22:40:18    阅读次数:688
高等特性
切片#切片L = ['Michael', 'Sarah', 'Tracy', 'Bob', 'Jack']print(L[0:3])print(L[:3])print(L[1:3])print(L[:10:2])print(L[::5])print(L[:]) #复制一个listprint((0, ...
分类:其他好文   时间:2015-11-26 18:57:30    阅读次数:182
python 命令行参数,以及文件操作
1 #demo.py2 #!/usr/bin/python 3 import sys4 5 print sys.argv #python demo.py 11 22 33 44 55 ['demo.py', '11', '22', '33', '55'] 可见,sys.argv是一个list,...
分类:编程语言   时间:2015-11-26 18:49:42    阅读次数:248
STL - 容器 - UnorderedSet(一)
一些简单操作UnorderedSetTest.cpp#include #include #include "../../Core/print.hpp"#include "UnorderedSetTest.h"using namespace std;void UnorderedSetTest::sim...
分类:其他好文   时间:2015-11-26 17:07:01    阅读次数:145
find中的-print0和xargs中-0的奥妙【转】
find cygnus/firmware_cygnus/target/linux/brcm5830/files/arch/arm/mach-iproc/pm_iproc/ -name "*.c" -print | xargs grep "USB"原文地址:find中的-print0和xargs中-0...
分类:其他好文   时间:2015-11-26 16:55:55    阅读次数:168
用sed、awk、grep同时匹配多个条件(与模式、或模式)
同时匹配ABC 和 123:sed -n '/ABC/{/123/p}'awk '/ABC/&&/123/{ print $0 }'grep -E '(ABC.*123|123.*ABC)'匹配ABC 或 123:sed -n '/\(ABC\|123\)/p'awk '/ABC/||/123/{ ...
分类:其他好文   时间:2015-11-26 15:18:54    阅读次数:610
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!