Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better define methods in main.py #19

Open
salastro opened this issue May 23, 2022 · 1 comment
Open

Better define methods in main.py #19

salastro opened this issue May 23, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@salastro
Copy link
Owner

Currently, exec is used, which is very unpythonic and inefficient. There should be a way to get all the functions in the func.py and link them accordingly.

    operations = ["inte", "diff", "lim", "fact", "sol",
                  "simp", "eval", "plot", "generate_pdf", "generate_latex"]

    for func in operations:
        exec(f"""
            \n@pyqtSlot()
            \ndef on_{func}_bt_clicked(self):
            \n    self.mathdoc.{func}(self.expression.toPlainText().\
                replace(" ", ""))
        """)
@salastro salastro added the bug Something isn't working label May 23, 2022
@salastro
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant