0

As example, my first module is

from sympy import *
x,y=symbols('x y')

def A():
    equation=2*x+y
    return equation

print(A())

the output is

2*x + y

my second module is

def B(x,y):
    equation=2*x + y
    return equation

I have to copy past the output of first module to second one each time from the terminal. Is there a way to pass this output automatically to the source code of B(x,y)?

Thank you for your attention

oguz
  • 3
  • 3
  • 2
    Have you consider merging the modules together? or importing the first module into the second, calling the first module in the second module and just passing the value in the same script? – MooingRawr Oct 14 '16 at 13:44
  • I will give it a shot. Thanks. – oguz Oct 14 '16 at 13:47
  • I tried it, but it outputs the same symbolic value. The type of the output is – oguz Oct 14 '16 at 13:53
  • Can you give us your input, and desired output? – MooingRawr Oct 14 '16 at 13:54
  • B(2,1) should output 5. With copy paste from terminal, it can succeed. I recently found this http://stackoverflow.com/questions/34195502/convert-symbolic-expressions-to-python-functions-using-sympy Maybe it could help – oguz Oct 14 '16 at 13:58
  • lamdify is the solution for my problem(above link). Thank you for your time. – oguz Oct 14 '16 at 14:06

0 Answers0