zoukankan      html  css  js  c++  java
  • cherrypy 给URL传默认参数

    code

    import random
    import string
    import cherrypy
    
    class StringGenerator(object):
        @cherrypy.expose
        def index(self):
            return "Hello world!"
    
        @cherrypy.expose
        def generate(self, length=8):
            return ''.join(random.sample(string.hexdigits, int(length)))
    
    if __name__ == '__main__':
        cherrypy.quickstart(StringGenerator())

  • 相关阅读:
    作业练习
    作业练习
    作业
    作业
    作业
    作业
    作业
    作业
    作业
    作业
  • 原文地址:https://www.cnblogs.com/sea-stream/p/14179073.html
Copyright © 2011-2022 走看看