0

Say I have a libgdx tic tac toe game and I want to make an AI in python to play against the user. Is there any way to run the AI from a java class ? If yes will it work for android ? Thanks for spending your time.

1 Answers1

0

For executing Python code from Java, please see Calling Python in Java?

For executing Python from an Android project written in Java, please check Execute python script from android App in Java

Dependent on how complex your (already written?) AI is, it is maybe easier to port it to java.

Sebastian
  • 5,721
  • 3
  • 43
  • 69
  • I am trying to import org.python.util.PythonInterpreter. I can do it in a normal java project but it doesnt work in a libgdx project for some reason. The intellisense works but when I run it, it does not compile. I am using intellij – Bino Manjesh Apr 08 '19 at 14:13