mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2024-11-27 14:01:09 +00:00
16 lines
265 B
Python
16 lines
265 B
Python
#!/usr/bin/python3
|
|
|
|
from sympy import *
|
|
import sys
|
|
|
|
def solver(x):
|
|
sympy_eq = sympify("Eq(" + x.replace("=", ",") + ")")
|
|
result = solve(sympy_eq)
|
|
return result[0]
|
|
|
|
def main(x):
|
|
X = solver(x)
|
|
print("X = " + str(X))
|
|
|
|
if __name__ == "__main__":
|
|
main(sys.argv[1]) |