tools.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:Harmonbot 作者: Harmon758 项目源码 文件源码
def differentiate(self, *, equation : str):
        '''
        Differentiate an equation
        with respect to x (dx)
        '''
        x = sympy.symbols('x')
        try:
            await self.bot.embed_reply("`{}`".format(sympy.diff(equation.strip('`'), x)), title = "Derivative of {}".format(equation))
        except Exception as e:
            await self.bot.embed_reply(py_code_block.format("{}: {}".format(type(e).__name__, e)), title = "Error")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号