Python is not a natively-supported language in Godot. There are ways to communicate with it but it will be harder than using GDScript, C or C#.
I wrote a similar answer in an older post: https://godotengine.org/qa/50247/how-can-i-use-godot-as-machine-learning-environment?show=50247#q50247
Either use the Python binding made by TouilleMan, or use a system call to invoke the script (like a shell command would do), use C# to embed IronPython, or make your python system run on its own and communicate with network socket.
Note that if your code involves library dependencies, some of these solutions won't work if their python runtime doesn't have access to them.