Python ValueError: too many values to unpack

self.materials is a dict and by default you are iterating over just the keys (which are strings). Since self.materials has more than two keys*, they can’t be unpacked into the tuple “k, m“, hence the ValueError exception is raised. In Python 2.x, to iterate over the keys and the values (the tuple “k, m“), we use self.materials.iteritems(). However, since you’re throwing the key away anyway, you may as … Read more

Clickable link inside message discord.py

As the other answer explained, you can’t add hyperlinks in normal messages, but you can in Embeds. I don’t see why you wouldn’t want to use an Embed for an error message, especially considering it adds more functionality, so you should consider using that. Feel free to mess around with the Embed & add some fields, a … Read more

Internal Redirect in Flask

You should use the Post-Redirect-Get pattern. And if you want to pass data to the target function (like that token) you can use the session object to store it So that would break down something like Edit: I haven’t used Flask-JWT before and didn’t know about the post requirement. But you can tell Flask to redirect … Read more

Should I use np.absolute or np.abs?

It’s likely because there a built-in functions with the same name, abs. The same is true for np.amax, np.amin and np.round_. The aliases for the NumPy functions abs, min, max and round are only defined in the top-level package. So np.abs and np.absolute are completely identical. It doesn’t matter which one you use. There are several advantages to the short names: They are shorter and they are known to Python … Read more