I have a tkinter GUI project. in this project I can load files and run tests on them. I would like to be able to write a script which does this from the command line. This means I need to run the main script, lets call it view.py and then run 2 callback functions from it, each one is a callback function for a button. Lets call this functions load(file), run(). These function are member functions of 2 different objects that are being created in the view.py script. Their names are load_button and run_button. How can I do that?
I can run the mainloop script view.py but dont know how to run functions that are defined in the file.
In functionFile.py:
def sayHello():
print("hello world")
CMD:
python -c "import functionFile; functionFile.sayHello()"
(you can also import every function or just specific ones: from functionFile import *; sayHello() or from functionFile import sayHello(); sayHello())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With