I'm unclear what you're trying to achieve with the functions. exec()
takes a string of Python code and executes it. The entire string must
be valid Python code by itself, so exec('return x') fails because a
bare "return x" is not valid Python. "return" must be inside a
function definition to be val
If the graphics you are producing are based on data, I think matplotlib is
your best option for producing publication quality figures, at least using
Python. For the sort of figure you've created, I would also look at TikZ,
which can produce similar quality images directly in LaTeX. Asymptote looks
The following code is not working as I expected.
Why does Sym1 contain an underline (_{1})?
Why does return fail (unhandled exception) in line 7?
Code:
import sympy
from sympy import symbols, latex
def defSym1():
return Sym1
def defSym2():
strSym = 'return Sym2'
exec(strSym)
Sym1 = sy
One thing I think is lacking in python is the ability to generate report
quality graphics directly. The best available is matplotlib which
doesn't really do the job all the time. I have a paper I wrote (for my
own edification) using sympy and galagebra to solve the Foucault
pendulum. For gra
Hi all,
My Name is Nishant Sushmakar currently a 3rd yr Undergrad Majoring in
Mathematics and Computer Science from Delhi Technological University,
India. I have used this package a lot in my practical for Scientific
computing , Stochastic process and now I feel obliged to contribute .I am
pro