导航

上一页 1 2 3 4 5 6 7 8 9 10 ··· 37 下一页

2016年5月18日

摘要: from pytz import timezone def datetime_as_timezone(date_time, time_zone): tz = timezone(time_zone) utc = timezone('UTC') return date_time.replace(tzin 阅读全文

posted @ 2016-05-18 13:22 网名还没想好 阅读(374) 评论(0) 推荐(0) 编辑

摘要: http://www.dannysite.com/blog/122/ Python标准库中的datetime模块提供了各种对日期和时间的处理方法。从本文的主题着手,首先利用datetime中提供的utcnow()方法获取到当前UTC时间: 1 2 3 4 >>> import datetime >> 阅读全文

posted @ 2016-05-18 13:03 网名还没想好 阅读(977) 评论(0) 推荐(0) 编辑

摘要: Django下载中文名文件: from django.utils.http import urlquote from django.http import HttpResponse content = export.export_to_xls() response = HttpResponse()r 阅读全文

posted @ 2016-05-18 10:52 网名还没想好 阅读(1107) 评论(0) 推荐(0) 编辑

摘要: http://stackoverflow.com/questions/972/adding-a-method-to-an-existing-object-instance 532down voteaccepted +50 +50 In Python, there is a difference be 阅读全文

posted @ 2016-05-18 10:39 网名还没想好 阅读(208) 评论(0) 推荐(0) 编辑

2016年5月11日

摘要: from :http://masnun.com/2015/11/20/python-asyncio-future-task-and-the-event-loop.html Event Loop On any platform, when we want to do something asynchr 阅读全文

posted @ 2016-05-11 14:17 网名还没想好 阅读(535) 评论(0) 推荐(0) 编辑

2016年5月8日

摘要: 转自http://blog.itpub.net/29018063/viewspace-2079767 大家在学习python开发时可能经常对迭代器、生成器、yield关键字用法有所疑惑,在这篇文章将从理论+程序调试验证的方式详细讲解这部分知识,话不多说,直接进入主题。一、迭代器(Iterater): 阅读全文

posted @ 2016-05-08 14:31 网名还没想好 阅读(388) 评论(0) 推荐(0) 编辑

摘要: 转自http://www.jackyshen.com/2014/10/02/functional-programming-in-Python/ 函数式编程 如果程序中的函数仅接受输入并产生输出,即输出只依赖于输入,内部数据不可变,避免保存程序状态,用同样的输入值反复调用可以得到相同的结果,那么这种编 阅读全文

posted @ 2016-05-08 12:22 网名还没想好 阅读(359) 评论(0) 推荐(0) 编辑

摘要: 转自:http://www.jackyshen.com/2015/05/21/async-operations-in-form-of-sync-programming-with-python-yielding/ 目录 回顾同步与异步编程 回顾多线程编程 yield与协程 异步编程同步化 回顾同步与异 阅读全文

posted @ 2016-05-08 12:06 网名还没想好 阅读(681) 评论(0) 推荐(0) 编辑

2016年5月7日

摘要: 【转自】http://sahandsaba.com/understanding-asyncio-node-js-python-3-4.html Introduction I spent this summer working on a web platform running on Node.js. 阅读全文

posted @ 2016-05-07 19:34 网名还没想好 阅读(200) 评论(0) 推荐(0) 编辑

2016年5月6日

摘要: The simpliest way to retrieve data from tables is take them all. To do this, you can write: 1 all_entries = Entry.objects.all() 1 all_entries = Entry. 阅读全文

posted @ 2016-05-06 19:11 网名还没想好 阅读(459) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 10 ··· 37 下一页