python
actsai
这个作者很懒,什么都没留下…
展开
-
python的回调函数
今天用到了python的回调函数,原来学习C++是就接触过回调函数,但是一直没有实际的使用经验,没有真正理解回调函数的作用。知识总是这样,只用在用的时候才能真正理解它的意义。在当前类需要改变其他类的类参数时就用到回调函数。用代码表示或许更直接显示回调函数的作用:testHook.py中的代码#coding=utf-8class TestHook(object):def __原创 2012-05-09 16:44:16 · 1617 阅读 · 0 评论 -
用python urllib2.urlopen(fileurl) 读取网络文件问题解决
urllib2.URLError: 解决方案:Internet选项的局域网(LAN)设置 区域中的两个选框取消选中,同时代理设置也要取消,至于为什么还有待深入研究原创 2012-05-14 14:34:41 · 5124 阅读 · 0 评论 -
python import unicodedata 错误的解决
昨天开始学习django,但是到第二章的时候就卡住了,错误如下。本来以为是django的错,重装了两遍,问题没有解决,后来就google但是没有解决方案。后来发现unicodedata有可能是python的模块,就重装了python,结果不出所料,问题解决了,希望大家引以为戒。原创 2012-05-16 08:06:32 · 4628 阅读 · 1 评论 -
python调用exe程序
起初使用os.system(),使用cmd打开程序,但是会显示cmd窗口影响程序的美观;查找python文档发现os.startfile()方法,文档如下:Start a file with its associated application.When operation is not specified or 'open', this acts like double-clicki原创 2012-06-06 09:44:41 · 4668 阅读 · 0 评论 -
Advice From An Old Programmer(Learn Python The Hard Way, 2nd Edition)
You've finished this book and have decided to continue with programming. Maybe it will be a career for you, or maybe it will be a hobby. You'll need some advice to make sure you continue on the right转载 2012-07-01 18:32:37 · 499 阅读 · 0 评论