问题
I have been programming a Python desktop app in Python 3.7 with tkinter. Many of my friends have said using it as an mobile application will get more users. I have been working with sklearn and different modules in Python to run along side the GUI. Is it possible to call that script in Kotlin?
回答1:
Yes it is possible. Python has REPL, it's own interactive interpreter and as it turns out Kotlin has a REPL as well. You'll still have to do research and find the interfaces to use with your front end.
NOTE: In Intellij Idea Kotlin has REPL. I'm afraid I don't know if it's the same with other IDEs.
If it's only for Android, you can use QPython. QPython is a script engine which runs Python programs on android devices.
来源:https://stackoverflow.com/questions/54021771/is-there-a-way-to-call-python-script-inside-of-a-kotlin-project