mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-22 15:17:00 +01:00
Updated Code snippets (markdown)
parent
ce60d15d78
commit
8af6fe12d6
1 changed files with 1 additions and 1 deletions
|
@ -202,7 +202,7 @@ Where `photos` is a list of `PhotoSize` objects and `desired_size` is a tuple co
|
|||
>>> def get_closest(photos, desired_size):
|
||||
>>> def diff(p): return p.width - desired_size[0], p.height - desired_size[1]
|
||||
>>> def norm(t): return abs(t[0] + t[1] * 1j)
|
||||
>>> return sorted(photos, key=lambda p: norm(diff(p)))[0]
|
||||
>>> return min(photos, key=lambda p: norm(diff(p)))
|
||||
```
|
||||
|
||||
#### Download a file
|
||||
|
|
Loading…
Reference in a new issue