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

Python 基础 1

1.解释性 可以直接从源代码运行程序.在计算机内部,Python解释器把源代码转换成称为字节码的中间形式,然后再把它翻译成计算机使用的机器语言并运行.
2.#符号后面的内容都是注释.
3.在字符串中行末的'\'表示下一行的内容和上一行是接着的;字符串前加一个r表示某些不需要转义符那样的特别处理的字符串;在处理文本文件的时候使用 Unicode字符串,特别是这个文件中包含有用非英语的语言写的文本;一定要用自然字符串表示正则表达式,不包括 char这个类型.
4.基本的数据类型包括数和字符串.数的类型包括:四类, 整数,长整数,浮点数和复数.
5.使用变量时,只需赋值给他们即可.
6.在逻辑行首的空白用来决定逻辑行的缩进层次,从而用来决定语句的分组.
7.运算符:'a'+'b'='ab','la'*3='lalala',3**4表示3的4次幂,//:取整除,%:取模,大于小于号可以任意连接,==比较对象是否相等,not 表示布尔非,and 布尔与,or 布尔或


相关文档:

[Python module] queue

8.8. queue — A synchronized queue class¶
queue -- 一个同步队列类
The queue module implements multi-producer, multi-consumer queues. It is especially useful in threaded programming when information must be exchanged safely between multiple threads. The Queue class in this module implemen ......

[Python module] threading

threading — Higher-level threading interface
This module constructs higher-level threading interfaces on top of the lower level _thread module. See also the queue module.
The dummy_threading module is provided for situations where threading cannot be used because _thread is missing.
  ......

PYTHON设置默认语言编码

原帖:http://www.cnblogs.com/jingleguo/archive/2008/06/02/1211820.html
当python中间处理非ASCII编码时,经常会出现如下错误:
UnicodeDecodeError: 'ascii' codec can't decode byte 0x?? in position 1: ordinal not in range(128)
0x??是超出128的数字,python在默认的情况下认为语言的编码是ascii编码,所以无法 ......

Python: python的简单表达式计算器

这是一个简单的表达式计算器, 不太懂用Tkinter写GUI, 参考了别人的代码
from __future__ import division
from Tkinter import Tk, Entry, Button, Label, mainloop
from tkFont import Font
def get_value ():
v = ''
try:
v = eval(text.get()) #use eval to calculate the vlaue of the text
except:
pa ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号