多线程可以共享全局变量,多进程不能。多线程中,所有子线程的进程号相同;多进程中,不同的子进程进程号不同。 1 #!/usr/bin/python 2 # -*- coding:utf-8 -*- 3 import os 4 import threading 5 import multiprocess...
分类:
编程语言 时间:
2014-09-05 12:56:01
阅读次数:
209
union 和union all都是将两个select语句的结果作为一个整体显示出来,把两条记录合并成一个查询,但是前提,所选的记录的两个表的字段名要一致但是两者又有区别:UNION: 指定合并多个结果集并将其作为单个结果集返回(去重并进行默认规则的排序)。unionALL: 将全部行并入结果中,其...
分类:
其他好文 时间:
2014-09-05 12:45:51
阅读次数:
211
When packaging an apk, all classes of all libraries used by the program will be included, this makes the apk very huge, even exceeds the capacity of.....
分类:
其他好文 时间:
2014-09-05 12:41:01
阅读次数:
145
才开始学习Python,我个人喜欢边看实例边学习其中的知识点,于是在网上找到了“Python100例”,案例很不错,但是其中有几个例子不能正确实现,比如第29个例子--“给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字”,如下图:上面写的方法运行的时候是不正确的,如果有同样在...
分类:
其他好文 时间:
2014-09-05 12:39:12
阅读次数:
224
正则表达式和python的re模块
By 钟桓
9月 4 2014 更新日期:9月 4 2014
文章目录
1. 什么是正则表达式2. 元字符使用一览表:3. 字符转义4. 重复5. 字符类6. 分支条件7. 分组8. re模块
8.0.1. compile8.0.2. match和search8.0.3. split8.0.4. findall8.0.5. findite...
分类:
编程语言 时间:
2014-09-05 11:29:41
阅读次数:
309
/**
* A listener for all the change in the preference file. It is used to maintain the global state of the application.
*/
private class PreferenceListener implements SharedPreference...
分类:
其他好文 时间:
2014-09-05 11:25:31
阅读次数:
219
让我们考虑更复杂的一种场景:产品是各不相同的。这时只记录一个数量就不够了,还需要记录每个产品的细节。很容易想到需要用一个容器将这些产品记录下来。Python的Queue模块中提供了同步的、线程安全的队列类,包括FIFO(先入先出)队列Queue,LIFO(后入先出)队列 LifoQueue,和优先级...
分类:
编程语言 时间:
2014-09-05 09:56:31
阅读次数:
251
一:循环 忙等 子进程结束import subprocess import os import time tt = '555' cmd = "python /home/100003/python/mypython/sub2.py "+" 333"+" 444 "+tt print time...
分类:
编程语言 时间:
2014-09-05 09:55:51
阅读次数:
194
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Given1->2->3-...
分类:
其他好文 时间:
2014-09-05 05:31:40
阅读次数:
176
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2014-09-05 05:31:30
阅读次数:
224