多线程的一个实例#coding=utf-8#!/usr/bin/pythonimport time import thread def timer(no, interval): cnt = 0 while cnt<10: time.sleep(interval...
分类:
编程语言 时间:
2015-02-01 20:23:16
阅读次数:
185
一. 使用模块
引入sys模块,使用import
#!/usr/bin/env python
# -*- coding: utf-8 -*-
' a test module '
__author__ = 'Michael Liao'
import sys
def test():
args = sys.argv
if len(args)==1:
print...
分类:
编程语言 时间:
2015-02-01 10:53:18
阅读次数:
231
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'32: Longest Valid Parentheseshttps://oj.leetcode.com/problems/longest-valid-parentheses/Gi...
分类:
编程语言 时间:
2015-02-01 01:52:20
阅读次数:
319
代码: 1 # -*- coding:utf8 -*- 2 from PyQt4.QtGui import * 3 from PyQt4.QtCore import * 4 import sys 5 6 class ani(QWidget): 7 def __init__(self): 8...
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'31: Next Permutationhttps://oj.leetcode.com/problems/next-permutation/Implement next permu...
分类:
编程语言 时间:
2015-01-31 07:01:44
阅读次数:
180
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'30: Substring with Concatenation of All Wordshttps://oj.leetcode.com/problems/substring-wi...
分类:
编程语言 时间:
2015-01-31 00:09:50
阅读次数:
173
# -*- coding: utf8 -*-'''__author__ = 'dabay.wang@gmail.com'29: Divide Two Integershttps://oj.leetcode.com/problems/divide-two-integers/Divide two int...
分类:
编程语言 时间:
2015-01-30 21:00:37
阅读次数:
120
1.在coding.net注册帐号。2.安装github,自己百度github软件然后安装。3.打开coding.net 输入帐号后新建项目创建项目创建后,创建ssh公钥,如果不创建的话,在每次进入的时候都要输入用户名和密码。1.从程序目录中右击,打开 "Git Bash"2. 键入命令:ssh-k...
分类:
Web程序 时间:
2015-01-30 19:13:59
阅读次数:
243
代码如下: #!/usr/bin/env?python
#?coding=utf-8
import?urllib2
import?xml.dom.minidom
try:
????url="http://weather.yahooapis.com/forecastrss?u=c&w=2151330"
????request?=?urllib2.Reque...
分类:
编程语言 时间:
2015-01-30 16:20:21
阅读次数:
404
一、文件形式的邮件 #!/usr/bin/env?python3
#coding:?utf-8
import?smtplib
from?email.mime.text?import?MIMEText
from?email.header?import?Header
sender?=?‘***‘
receiver?=?‘***‘
subject?=...
分类:
编程语言 时间:
2015-01-30 16:18:53
阅读次数:
198