类别归档:Python

Python is a programming language that lets you work quickly and integrate systems more effectively.

RSS feed of Python

Python与Java的主要区别

原文链接:Python vs Java: Key Differences

Python and Java are two very different programming languages, but both can be useful tools for modern developers. If you are thinking about learning to program for the first time, then you might find ...

继续阅读

Python LEGB作用域规则简述

What exactly are the Python scoping rules?

Python的作用域规则到底指的是什么?

If I have some code:

如果我有一段代码:


code1
class Foo:
   code2
   def spam.....
      code3
      for code4..:
       code5
       x()

Where is x found? Some possible choices include the list above:

x在哪里能找到?可能的选择列举如下:

  1. In the ...

继续阅读

Python程序员常犯的10个错误

原文链接:http://www.toptal.com/python/top-10-mistakes-that-python-programmers-make

BY MARTIN CHIKILIAN - SENIOR SOFTWARE ENGINEER @ TOPTAL

About Python 关于Python

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing ...

继续阅读

Web.py配置自定义404和500错误信息

Web.py如何自定义Http404和Http500错误信息?


import web

urls = (...)
app =  web.application(urls, globals())

def notfound():
    return web.notfound("Sorry, the page you were looking for was not found.")

    # You can use template result like below, either is ok:
    #return web.notfound(render.notfound ...

继续阅读