Chinaunix首页 | 论坛 | 博客
  • 博客访问: 387859
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

发布时间:2015-05-26 20:25:30

divmod(a,b)函数中文说明:divmod(a,b)方法返回的是a//b(除法取整)以及a对b的余数返回结果类型为tuple参数:a,b可以为数字(包括复数)版本:在python2.3版本之前不允许处理复数,这个大家要注意一下英文说明:Take two (non complex) numbers as arguments and return a pair of numbers consisting of their q.........【阅读全文】

阅读(1460) | 评论(0) | 转发(0)

发布时间:2015-05-26 20:18:22

中文说明:删除object对象名为name的属性。这个函数的命名真是简单易懂啊,和jquery里面差不多,但是功能不一样哦,注意一下。参数object:对象。参数name:属性名称字符串。版本:各版本中都支持该函数,python3中仍可用。英文说明:This is a relative of setattr(). The arguments are an object and a string. The .........【阅读全文】

阅读(1106) | 评论(0) | 转发(0)

发布时间:2015-05-26 19:56:52

complex([real[, imag]])中文说明:创建一个值为real + imag * j的复数或者转化一个字符串或数为复数。如果第一个参数为字符串,则不需要指定第二个参数。参数real: int, long, float或字符串;参数imag: int, long, float。英文说明:Create a complex number with the value real + imag*j or convert a string or .........【阅读全文】

阅读(1226) | 评论(0) | 转发(0)

发布时间:2015-05-26 19:29:21

中文说明:classmethod是用来指定一个类的方法为类方法,没有此参数指定的类的方法为实例方法,使用方法如下:class C:    @classmethod    def f(cls, arg1, arg2, ...): ...类方法既可以直接类调用(C.f()),也可以进行实例调用(C().f())。版本:python2.2中新增,在python2.4中增加新功能。pyt.........【阅读全文】

阅读(1332) | 评论(0) | 转发(0)

发布时间:2015-05-26 19:20:26

中文说明:返回整数i对应的ASCII字符。与ord()作用相反。参数x:取值范围[0, 255]之间的正数。版本:该函数在python2和python3各个版本中都可用。不存在兼容性问题。英文说明:Return a string of one character whose ASCII code is the integer i. For example, chr(97) returns the string 'a'. This is the invers.........【阅读全文】

阅读(941) | 评论(0) | 转发(0)

发布时间:2015-05-26 19:15:09

中文说明:检查对象object是否可调用。如果返回True,object仍然可能调用失败;但如果返回False,调用对象ojbect绝对不会成功。注意:类是可调用的,而类的实例实现了__call__()方法才可调用。版本:该函数在python2.x版本中都可用。但是在python3.0版本中被移除,而在python3.2以后版本中被重新添加。英文说明:Return .........【阅读全文】

阅读(1051) | 评论(0) | 转发(0)

发布时间:2015-05-26 17:12:20

中文说明:bytearray([source [, encoding [, errors]]])返回一个byte数组。Bytearray类型是一个可变的序列,并且序列中的元素的取值范围为 [0 ,255]。参数source:如果source为整数,则返回一个长度为source的初始化数组;如果source为字符串,则按照指定的encoding将字符串转换为字节序列;如果source为可迭代类型,.........【阅读全文】

阅读(1520) | 评论(1) | 转发(0)

发布时间:2015-05-26 12:24:32

英文说明:Convert a value to a Boolean, using the standard truth testing procedure. If x is false or omitted, this returns False; otherwise it returns True. bool is also a class, which is a subclass of int. Class bool cannot be subclassed further. Its only instances are False and True.New in versio.........【阅读全文】

阅读(1181) | 评论(0) | 转发(0)

发布时间:2015-05-26 12:18:55

bin(x)英文说明:Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to define an __index__() method that returns an integer.New in version 2.6.中文说明:将整数x转换为二进制字符串,如果x不为Python中int类型,x必须包含方法_.........【阅读全文】

阅读(963) | 评论(0) | 转发(0)

发布时间:2015-05-26 12:11:10

说明:如果iterable的任何元素不为0、''、False,all(iterable)返回True。如果iterable为空,返回False。函数等价于:注意比较该函数与all()函数的区别,any是任意,而all是全部。建议比较学习两者的区别与联系。可以参考《python函数每日一讲 - all()》def any(iterable):   for element in iterable: .........【阅读全文】

阅读(911) | 评论(0) | 转发(0)

发布时间:2015-05-26 11:03:16

说明:如果iterable的所有元素不为0、''、False或者iterable为空,all(iterable)返回True,否则返回False参数iterable:可迭代对象>>> all(['a', 'b', 'c', 'd'])  #列表list,元素都不为空或0True>>> all(['a', 'b', '', 'd'])  #列表list,存在一个为空的元素False>>> all([0, 1,2, 3])  #列表list.........【阅读全文】

阅读(910) | 评论(0) | 转发(0)

发布时间:2015-05-26 10:47:40

先看官方英文文档解释abs(x)Return the absolute value of a number. The argument may be a plain or long integer or a floating point number. If the argument is a complex number, its magnitude is returned.详解:返回绝对值参数可以是:负数、正数、浮点数或者长整形实例:abs(-1.2) #返回 1.2abs(1.2) .........【阅读全文】

阅读(819) | 评论(0) | 转发(0)

发布时间:2015-05-18 14:32:01

typedef struct ArcNode{/*单链表中的结点的类型*/int  adjvex;                /*该边指向的顶点在顺序表中的位置*/struct ArcNode  *next;        /*下一条边*/}ArcNode;typedef struct VNode{/*顶点类型*/int  data;     .........【阅读全文】

阅读(954) | 评论(0) | 转发(0)

发布时间:2015-05-18 14:29:13

typedef struct BiTNode{    char data;   /*结点的数据域*/    struct BiTNode *lchild , *rchild;  /*指向左孩子和右孩子*/} BiTNode , *BiTree;/*创建一棵二叉树*/CreatBiTree(BiTree *T){    char c;    scanf("%c",&c);    if(c == ' ') *T = NU.........【阅读全文】

阅读(1064) | 评论(0) | 转发(0)

发布时间:2015-05-18 14:28:05

#include "stdio.h"typedef char ElemType;typedef struct QNode{    ElemType data;    struct QNode *next;} QNode , *QueuePtr;typedef struct{    QueuePtr front;   //队头指针    QueuePtr rear;    //队尾指针}LinkQueue;initQueue(LinkQueue *.........【阅读全文】

阅读(910) | 评论(0) | 转发(0)

发布时间:2015-05-18 14:24:47

#include "stdio.h"#include "math.h"#define STACK_INIT_SIZE 20#define STACKINCREMENT 10typedef  char ElemType;typedef struct{    ElemType *base;    ElemType *top;    int stacksize;}sqStack;initStack(sqStack *s){    /*内存中开辟一段连续空间.........【阅读全文】

阅读(1226) | 评论(0) | 转发(0)

发布时间:2015-05-15 17:23:11

typedef int ElemType;typedef struct node{    ElemType data;   /*数据域*/    struct node *next;  /*指针域*/}LNode,*LinkList;LinkList GreatLinkList(int n){    LinkList p,r,list=NULL;    ElemType e;  &n.........【阅读全文】

阅读(960) | 评论(0) | 转发(0)

发布时间:2015-05-15 17:10:57

#define MaxSize 10typedef int ElemType ;  /*将int定义为ElemType*/typedef struct{int *elem;int length;int listsize; } Sqlist;/**  初始化一个顺序表  *//**  参数L:Sqlist类型的指针  */void initSqlist(Sqlist *L){    L->elem=(int *)malloc(MaxSize*.........【阅读全文】

阅读(1003) | 评论(0) | 转发(0)

发布时间:2015-05-12 21:51:29

第一步 安装python并设置环境变量 1.安装python: python下载地址https://www.python.org/,建议用2.7.x版本 2.设置环境变量: 方法如下所示  第二步 安装Robot framework 下载地址如下:https://pypi.python.org/pypi/robotframework/2.8.5 如果安装了pip工具,则可以直.........【阅读全文】

阅读(1744) | 评论(0) | 转发(0)

发布时间:2015-05-12 14:58:56

#include "stdio.h"#define MaxSize 10/*静态顺序表的各种操作*//**   向顺序表中插入元素    *//**   参数Sqlist:表首地址    *//**   参数*len: 表的长度     *//**   参数i: 插入元素的位置 *//**   参数x:待插入的元素值  */void insertElem(int .........【阅读全文】

阅读(927) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册