tools.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号