Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I display python code as a math formula?

How can I display python code as a math formula in the console application?

Example:

 a=1
 b=1
 c=1
 y=(pow(a,2)-2*b-pow(c,2))/(3*a*b)

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I believe the sympy package is what you’re looking for. It can pretty print equations in the console. You’ll want to use the the preview function to creat e.g. a PNG, which a browser can easily open or can be linked to in a HTML file— you’ll need to have LaTeX installed to do this.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading