Python
之数据类型讲解
Number
(数字)
包括
int,long,float,double,complex
String
(字符串)
例如:
hello,"hello",hello
List
(列表)
例如:
[1,2,3],[1,2,3,[1,2,3],4]
Dictionary
(字典)
例如:
{1:"nihao",2:"hello"}
Tuple
(元组)
例如:
(1,2,3,abc)
File
(文件)
例如:
f = open(a.txt,rw)
python
还可以引用
C
语言变量
import ctypes
可以通过
help(ctypes)
查看有多少个类型
这里介绍下指针类型
>>> n = ctypes.c_int(100)
>>> p = ctypes.pointer(n)
>>> print p
<__main__.LP_c_long object at 0x01FF4EE0>
>>> print n
c_long(100)
>>> p.contents