第1步:下载Python3.4下载地址如下:下载Mac OS X 64-bit/32-bit installerhttps://www.python.org/downloads/release/python-340/第2步: 安装安装下载的dmg文件第3步: 配置[plain]view plainc...
分类:
编程语言 时间:
2015-08-10 23:52:37
阅读次数:
249
3.4.6items和iteritems说明:items以列表方式返回字典中的键值对,iteritems以迭代器对象 返回键值对儿(Python3中不再支持);例子: 1: >>> x 2: {'name': 'Bill'} 3: >>> x.items() 4: dict_items([(...
分类:
编程语言 时间:
2015-08-10 23:45:56
阅读次数:
198
在这篇之前,我又专门翻译过官方python3.3的可哈希对象文档,大家可以先参考一下:实习小记-python中可哈希对象是个啥?what is hashable object in python?预备知识: 在定义一个类时,如果我们需要改写该类的__eq__函数,特别要注意的是它将会变为不可哈希对....
分类:
编程语言 时间:
2015-08-10 21:46:51
阅读次数:
104
Tomorrow源代码 项目地址作者madisonmay from functools import wrapsfrom concurrent.futures import ThreadPoolExecutorclass Tomorrow(): def __init__(self, future, ...
分类:
编程语言 时间:
2015-08-10 01:40:31
阅读次数:
634
或者收发邮件都得小心翼翼的,怕一不小心被有心人瞧见,又得被说说。为了能发邮件而不被发现,嘿嘿。我就用python写了个邮件发送程序,用控制台控制,不了解的人一定以为哥还在编程工作呢。哈哈。 以下简介下怎样使用python发送邮件,包含普通文本内容,也能够带附件,或者HTML内容的邮件。能够说有了py...
分类:
编程语言 时间:
2015-08-08 19:40:46
阅读次数:
136
#coding=utf-8import threading #进口threadingfrom time import sleepimport timedef task1(): print ("Task 1 executed." ) sleep(1)def task2(): pri...
分类:
编程语言 时间:
2015-08-07 21:59:36
阅读次数:
127
直接使用的标准模块smtpx.lsp, smtp.lsp你可以不设置port,庭审后,没用。以下是一个示例代码:#!/usr/bin/newlisp(set 'debug-flag true)(module "smtpx.lsp")(set 'r (SMTP:send-mail "from@my.c...
分类:
其他好文 时间:
2015-08-07 13:05:46
阅读次数:
155
python3 抓取网页资源的 N 种方法 1、最简单 ?urllib.request
response?=?urllib.request.urlopen()
html?=?response.read() 2、使用 Request ?urllib.request
?
req?=?urllib.request.Request()
respon...
分类:
编程语言 时间:
2015-08-07 07:13:44
阅读次数:
162
现在在学习Python的3.4,遇到了协程的慨念和yield from语法,大为疑惑,所以写了这篇博客,首先会写yield、yield from、coroutine和gevent,最后就是利用asynaio开发的一系列库了。
2015年08月06日23:52:54了,就写这么多吧,以后持续更新。
不知道CSDN的markdown能不能换css样式。。。
关键词 yield
在Python...
分类:
编程语言 时间:
2015-08-07 00:24:46
阅读次数:
228
import os,sys,os.pathprint('your current dir is {}'.format(os.getcwd()))if len(sys.argv)==1: while True: sourceDir=input('input source dir:'...
分类:
编程语言 时间:
2015-08-07 00:08:29
阅读次数:
155