From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_20 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Import Python library into an Ada package? Date: Fri, 4 Dec 2020 15:22:46 +0200 Organization: Tidorum Ltd Message-ID: References: <7223f058-c593-4905-b9ba-0a5cb3e64de2n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net qkV+E3enX56VnzpVjQtanwNU7zo/QGoVPFLlyjYeVcjl4+9lmu Cancel-Lock: sha1:kgKso1PZB0fQpKE42CYhPDoUhnw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 In-Reply-To: <7223f058-c593-4905-b9ba-0a5cb3e64de2n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:60696 List-Id: On 2020-12-04 9:36, Roger Mc wrote: > Is it possible to import a Python library, such as graphviz, into an Ada package? If you mean the Graphviz tool-set, https://en.wikipedia.org/wiki/Graphviz, that seems to be written in C and to be open source. You should be able to call Graphviz functions from Ada in the same way as one calls any C code from Ada. The Python module you refer to is probably just a binding from Python to the C code in Graphviz. If you want to use Graphviz just to draw automatically laid-out graphs, there is another way, that I have used: make the Ada program write out the graph definition as a text file in the "dot" language, and then invoke the "dot" program from Graphviz to lay out and draw the graph into some graphical format. However, it may be troublesome to make this method work interactively -- I was satified with non-interactive post-processing of the "dot" file generated by my Ada program.