Hi there,

I tried really hard, but I just don't get it -- would GDNative enable us to use Python scripts, which in turn utilize other, third-party Python libraries, in cross-platform development? To flesh out my question: I'm thinking of developing a molecular structure viewer as Godot VR application for smartphone-based HMDs. Retrieving and parsing molecular structure date (e.g. from PDB, https://www.rcsb.org/) isn't too difficult, but I would, of course, prefer to use existing libraries for this purpose. So I was wondering if it was possible to use, say: BioPython (https://biopython.org/wiki/The_Biopython_Structural_Bioinformatics_FAQ) for the intended Android application?

Cheers --

Torsten

7 days later

Maybe this question would be easier to answer if I added another constraint: Would GDNative enable us to use Python scripts, which in turn utilize other, third-party Python libraries, in cross-platform development, as long as those libraries are pure Python and don't rely on additional native libraries which are not part of a core Python installation? (In other words: I am talking about Python libraries which, when installed through, say, pip, wouldn't call an external compiler like gcc to create an .so/.dll/.whateveritscalledonmacos file.)

Cheers --

Torsten

Looking at issue number-78 and issue number-79 from the Godot-Python repository, I would say that right now it appears that it is not possible to use Python in a exported project right now.

Though, I suppose the best way to know for sure would be to make a simple project using a pure python library and see what happens when you export. I do not think it will work, but testing with a simple project would be the best way to know for sure.

I can confirm that exporting Python projects does not work, currently - you could however keep a copy of the Godot editor itself and happily run stuff without ever exporting. The Python bindings have another limitation, though - the libraries that dip into C cannot be used at all because the Python interpreter used by the bindings lacks the /includes folder, which is necessary for them to work (issue number 97). This affects many many libraries, such as numpy, scipy and pyvoronoi.

TwistedTwigleg & Zireael,

thanks for your replies, that clarified the matter!

So I'll have to implement a PDB parser in GDScript, sigh... Might be not so bad after all, though, since with a little luck it should be pretty straightforward to port existing (Bio-)Python code to GDScript, right?

Cheers --

Torsten

BioPython looks difficult to port, since a quick look reveals that it relies on Numpy and Networkx, among others.

I believe your best bet would be to post on issue number 97 and/or help me figure out how Python installs/downloads the /includes folder, so that the Python Godot bindings can work with Numpy and Networkx, and by extension with BioPython.

Zireael,

@Zireael said: BioPython looks difficult to port, since a quick look reveals that it relies on Numpy and Networkx, among others.

wow, you already had a look into BioPython? I haven't looked into the matter yet, but anyway my intention wasn't to port all of BioPython to GDScript. I'd rather focus on that part of BioPython which is responsible for parsing downloaded PDB data (downloading structural data should be rather straightforward with GDScript's HTTP capabilities), and I'd be surprised if the parser relied on external libraries. Well, we'll see...

I believe your best bet would be to post on issue number 97 and/or help me figure out how Python installs/downloads the /includes folder, so that the Python Godot bindings can work with Numpy and Networkx, and by extension with BioPython.

Well, my Python isn't that good (I'm more like a Java guy, with a bit of C#, PHP and Perl) and I'm still in the process of getting a grip on the Python ecosystem. So no promises here...

But thanks anyway for caring about my rather non-game-ish project! ;)

Cheers --

Torsten
4 years later