易截截图软件、单文件、免安装、纯绿色、仅160KB

Python 拷贝对象(深拷贝deepcopy与浅拷贝copy)

>>> import copy
>>> a = [1,2,3,4,['a','v']]
>>> b = a
>>> b
[1, 2, 3, 4, ['a', 'v']]
>>> c = copy.copy(a)
>>> c
[1, 2, 3, 4, ['a', 'v']]
>>> d = copy.deepcopy(a)
>>> d
[1, 2, 3, 4, ['a', 'v']]
>>> a.append(5)
>>> a
[1, 2, 3, 4, ['a', 'v'], 5]
>>> b
[1, 2, 3, 4, ['a', 'v'], 5]
>>> c
[1, 2, 3, 4, ['a', 'v']]
>>> d
[1, 2, 3, 4, ['a', 'v']]
>>> a[4].append('c')
>>> a
[1, 2, 3, 4, ['a', 'v', 'c'], 5]
>>> b
[1, 2, 3, 4, ['a', 'v', 'c'], 5]
>>> c
[1, 2, 3, 4, ['a', 'v', 'c']]
>>> d
[1, 2, 3, 4, ['a', 'v']]
>>>


相关文档:

Python字符串操作

 #Python字符串操作
''
'1.复制字符串'
''
#strcpy(
sStr1,
sStr2)
sStr1 =
'strcpy'
sStr2 =
sStr1
sStr1 =
'strcpy2'
print
sStr2
''
'2.连接字符串'
''
#strcat(
sStr1,
sStr2)
sStr1 =
'strcat'
sStr2 =
'append'
sStr1 +
=
sStr2
print
sStr1
''
'3.查找字符'
''
#strc ......

Python日期操作学习笔记

 http://www.itzn.cn/html/jiaoben/python-perl-VBA/200812/19-3283.html
字符串是使用静态的方式进行存储,只能读而不能直接修改字符内容。特别将一堆对字符串并在一起的时候,虽然可以直接相加,听说这样的速度奇慢,只有用其它函数的方式进行,好在也不太麻烦。
比如用 print ','.join(datelist)
就可以将date ......

Python完全新手教程

作者:taowen, billrice
http://www.cnblogs.com/taowen/articles/11239.html
Lesson 1 准备好学习Python的环境
下载的地址是:
www.python.org
为了大家的方便,我在校内作了copy:
http://10.1.204.2/tool/compiler&IDE/Python-2.3.2-1.exe
linux版本的我就不说了,因为如果你能够使用linux并安装好说明你可以 ......

Python的串口通讯第三方库PySerial

 最近要用到串口通讯,简单易用的Python又帮上忙了,多亏了庞大的第三方资源~~~ :)
pySerial
Overview
This module encapsulates the access for the serial port. It provides
backends for Python running on Windows, Linux, BSD (possibly any POSIX
compliant system), Jython and IronPython (.NET and M ......

对python的isinstance的认识

>>> class objA:
...     pass
...
>>> A = objA()
>>> B = 'a','V'
>>> B
('a', 'V')
>>> C = 'a string'
>>> print instance(A,objA)
Traceback (most recent call last):
  File "<stdin>", line 1, in < ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号