one-python-craftsman icon indicating copy to clipboard operation
one-python-craftsman copied to clipboard

来自一位 Pythonista 的编程经验分享,内容涵盖编码技巧、最佳实践与思维模式等方面。

Results 2 one-python-craftsman issues
Sort by recently updated
recently updated
newest added

reference: https://github.com/BYVoid/OpenCC

在`6-three-rituals-of-exceptions-handling.md`中 [3. 异常处理不应该喧宾夺主](https://github.com/piglei/one-python-craftsman/blob/master/zh_CN/6-three-rituals-of-exceptions-handling.md#3-%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%E4%B8%8D%E5%BA%94%E8%AF%A5%E5%96%A7%E5%AE%BE%E5%A4%BA%E4%B8%BB) 有以下异常处理代码 ``` def upload_avatar(request): """用户上传新头像""" try: avatar_file = request.FILES['avatar'] except KeyError: raise error_codes.AVATAR_FILE_NOT_PROVIDED try: resized_avatar_file = resize_avatar(avatar_file) except FileTooLargeError as e: raise error_codes.AVATAR_FILE_TOO_LARGE except ResizeAvatarError as e:...