perldoc CGI 中有如下内容(大家可以自己看下): For example, using the object oriented style, here is how you create a simple "Hello World" HTML page: #!/usr/local/bin/perl -w use CGI; # load CGI routines $q = new CGI; # create new CGI object print $q->header, # create the HTTP hea...
转自: http://wiki.wxpython.org/index.cgi/wxPython_style_Guide This is a little style guide for using wxPython. It's not the be-all and end-all of how wxPython code should be written, but I what I've tried to capture is a way to write wxPython code that is clear and Pythonic. It was vetted on the wxPython-users mailing list, with very little disagreement. Pythonic is partly defined by: http:/...
Multiple declarations can go on one line, but if the line gets too long don't try to continue it in some fancy way, just start a new declaration on the next line. Avoid declarations in all but the most complex inner blocks. Avoid initializations of automatic variable in declarations, since they can be mildly disconcerting when stepping through code with a debugger. 上面这段话中的"Avoid declaratio...
Blocks are supposedly the most liked feature in Ruby . This proposal would enable a similar feature in Python: using webapp.runner do (config): config.time_zone = 'UTC' config.log_level = 'debug' Compare that to the Ruby equivalent: Rails::Initializer.run do |config| config.time_zone = 'UTC' config.log_level = :debug end Unless I am missing something fundamental, adding a do st...