现在的位置: 首页 > Python
0℃
2013年08月31日 程序设计 ⁄ 被围观 3,316+
不论什么语言的开发,都会涉及到下面的几个问题,代码的运行时间,性能出现的瓶颈,内存的占用情况,是否有内存的泄露等等,同样Python也不例外,本文介绍了几个优秀的Python工具,可以实现如上所述问题的检测机制,通过动态运行跟踪代码的执行情况,从而发现问题点。 While it’s not always the case that every Python program you write will require a rigorous performance analysis, it is reassuring to know that there are a wide variety of tools in Python’s ecosystem that one can turn to when the...
阅读全文
0℃
2013年08月24日 程序设计 ⁄ 被围观 3,319+
本文基于Python后台搭建了一个视频服务器,集视频的上传,视频的格式转化,视频的播放于一体,后台基于Django框架和Amazon S3的存储,视频格式的转换基于Encoding.com的在线服务,消息队列基于RabbitMQ,视频上传和转换处理完毕后,采用浏览器的Html5播放,采用了Video.js。 Stickyworld's consultation web app has supported video for a long time but it's been hosted via a YouTube embed. When we started building the new version of the web app we wanted to take control of the video content and al...
阅读全文
0℃
2013年08月04日 程序设计 ⁄ 被围观 3,021+
我们都知道发布Python模块的时候需要准备几份文件,其中就包括了setup.py和requirements.txt,这两份文件中都需要填写待发布模块的依赖关系,那么是不是这样就会出现信息的重复,维护起来也不方便呢? 如下的文章解释了这两个文件中重复信息的不同功用,前者为“虚引用”,后者为“具体引用”,那么他们利用的场合和背后的机制是什么样子的,马上就会知晓了。 There's a lot of misunderstanding between setup.py and requirements.txt and their roles. A lot of people have felt they are duplicated information ...
阅读全文
0℃
2013年08月03日 程序设计 ⁄ 被围观 2,981+
相信开发过C++语言的同学都知道,inline内联函数,get和set函数通常都写成内联机制,为的是提高程序的运行效率,缩短函数调用的时间。那么开发过Android的同学,也应该知道,android程序优化中有一条机制就是尽量不用get和set函数,因为Java中不支持C++的内联机制,所以只能舍弃get和set方法,尽管有失面向对象的访问机制,但是对手持设备来说,合理利用有限资源,提高运行效率才是首选。 本文中讲的是怎样在Python语言中利用内联机制,Python是解释性的语言,没有编译过程,那么怎么在Python中实现内联机制呢?相...
阅读全文
0℃
2013年08月03日 程序设计 ⁄ 被围观 3,256+
怎么样打包自己的Python模块,并且分享到PyPI,相信下面的文章会给你一个满意的答案! A completely incomplete guide to packaging a Python module and sharing it with the world on PyPI. Abstract Few things give me caremads like Python modules I want to use that aren’t on PyPI (pronounced “pie pee eye”, or “cheese shop”, not “pie pie”!). On the other hand – aspydanny points out – the current situation on packaging is rather confusing. Therefore I want to help everyone who has some...
阅读全文
1℃
2013年05月15日 程序设计 ⁄ 被围观 3,726+
最近半年的时间,百度空间进行了多次变更,自从去年的wordpress百度空间博文同步插件不可用之后,就一直没有维护更新,最近百度空间基本稳定了,通过抓包对比分析,发现和以前的登录过程很不一样,先利用python脚本进行登录过程的模拟,然后再利用php实现,来维护更新同步插件。 大体的登录原理如下: 1. 首先获取登录的cookie文件,没有cookie的话,百度空间不能正常登录,访问如下网址获取cookie https://passport.baidu.com/v2/api/?getapi&class=login&tpl=mn&tangram=false 2. 获取登录过程的...
阅读全文
0℃
2011年09月12日 程序设计 ⁄ 被围观 4,128+
Python代码历来是讲究整洁的,但是也不乏高手能写出如此混乱而又有节奏的代码,下面的混乱代码就是用来生成彭罗斯铺砖图案的。 程序源码 _ = """if! 1:"e,V=100 0,(0j-1)**-.2; v,S=.5/ V.real, [(0,0,4 *e,4*e* V)];w=1 -v"def! E(T,A, B,C):P ...
阅读全文
1℃
这是一篇选自外文的评论文章,该文告诉我们为什么要选择python或者ruby,他们相比较其他的编程语言有哪些优势,对我们以后的开发会有怎样的帮助。 =========== 英文原文============ If you are a student, you probably know C, C++ and Java. A few know VB, or C# / .NET. At some point you’ve probably built some web pages, so you know HTML, CSS and maybe JavaScript. By and large, it is difficult to find students who have any exposure to languages beyond this. And this is a shame because th...
阅读全文
×
腾讯微博