gpt4 book ai didi

python - 编写此代码的更好方法?

转载 作者:太空宇宙 更新时间:2023-11-03 12:19:16 24 4
gpt4 key购买 nike

<分区>

我有以下代码,我认为它因为 vi 的重复而变得很糟糕。我怎样才能写得更好?

vi = '([a-zA-Z0-9_\-\.]+)'

handlers = [
(r'/register', RegistrationHandler),
(r'/profiles/%s/%s' % (vi, vi), GetProfiles),
(r'/archives/%s/%s/%s/%s' % (vi, vi, vi, vi), GetArchives),
(r'/publish-profiles', PublishProfiles),
(r'/publish-bundle/%s/%s' % (vi, vi), PublishBundle),
(r'/upload-file/%s/%s/%s' % (vi, vi, vi), UploadFile),
(r"/favicon\.ico", tornado.web.StaticFileHandler, dict(path=settings['static_path'])),
]

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com