Using exec() is generally not a good idea. It is useful for some rare
needs, but I'd recommend avoiding it if you can.

Jason
moorepants.info
+01 530-601-9791


On Tue, Jan 14, 2020 at 9:10 AM Jon Durand <[email protected]> wrote:

> Okay I got it working better now. The exec() function was putting it in as
> a string for the solver instead of as variables. It worked better doing
> exec from a newly created file instead
> of directly in line from the original script. Like this:
>
> with open('temp.py', 'w') as f:
>     f.write('b.solve_for_reaction_loads(' + reaction_symbols_vars + ')')
> exec(open("./temp.py").read())
> os.remove('temp.py')
>
> Now my script seems to be applying and solving loads correctly. But I
> still have some troubleshooting to do as for certain support combinations
> or support locations I'll get an error of:
>      deflection_curve = deflection_curve.subs({C4: constants[0][0]})
>      IndexError: list index out of range
>
> It's probably a similar issue to what I was getting before. Hopefully I'll
> figure things out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/03ed2c87-092f-401e-8f68-4985f97b7400%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/03ed2c87-092f-401e-8f68-4985f97b7400%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAP7f1Ahseetu9f4uHP6OxzuKhj618LrhZU5f0H0ZTJLLpc2%2Bkw%40mail.gmail.com.

Reply via email to