comp.lang.ada
 help / color / mirror / Atom feed
* Import Python library into an Ada package?
@ 2020-12-04  7:36 Roger Mc
  2020-12-04 10:23 ` Dmitry A. Kazakov
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-04  7:36 UTC (permalink / raw)


Is it possible to import a Python library, such as graphviz, into an Ada package?
So far I have only been able to find information on exporting Ada to Python.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04  7:36 Import Python library into an Ada package? Roger Mc
@ 2020-12-04 10:23 ` Dmitry A. Kazakov
  2020-12-04 11:37   ` Roger Mc
  2020-12-04 13:22 ` Niklas Holsti
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Dmitry A. Kazakov @ 2020-12-04 10:23 UTC (permalink / raw)


On 2020-12-04 08:36, Roger Mc wrote:
> Is it possible to import a Python library, such as graphviz, into an Ada package?
> So far I have only been able to find information on exporting Ada to Python.

I am not sure what you mean. Python is not a compiled language, so 
formally speaking a Python library is not a library and you cannot 
import it in the sense of linking it to your application and calling 
subprograms from it using certain calling conventions.

If you rather meant whether you could execute a Python script from Ada 
while passing parameters to it and taking results from, yes you can. If 
that script were a part of some Python module, yes you can load it and 
once loaded call (interpret) functions from the module.

P.S. Before you proceed, Python is a huge mess and interfacing it is a 
pain in the ... So you should consider if Graphviz worths the efforts. 
If you find a GTK or Qt library that doing approximately same, that
would be a wiser choice, IMO.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 10:23 ` Dmitry A. Kazakov
@ 2020-12-04 11:37   ` Roger Mc
  2020-12-04 13:55     ` Simon Wright
  0 siblings, 1 reply; 21+ messages in thread
From: Roger Mc @ 2020-12-04 11:37 UTC (permalink / raw)


On Friday, December 4, 2020 at 9:23:23 PM UTC+11, Dmitry A. Kazakov wrote:
> On 2020-12-04 08:36, Roger Mc wrote: 
> > Is it possible to import a Python library, such as graphviz, into an Ada package? 
> > So far I have only been able to find information on exporting Ada to Python.
> I am not sure what you mean. Python is not a compiled language, so 
> formally speaking a Python library is not a library and you cannot 
> import it in the sense of linking it to your application and calling 
> subprograms from it using certain calling conventions. 
> 
> If you rather meant whether you could execute a Python script from Ada 
> while passing parameters to it and taking results from, yes you can. If 
> that script were a part of some Python module, yes you can load it and 
> once loaded call (interpret) functions from the module. 
> 
> P.S. Before you proceed, Python is a huge mess and interfacing it is a 
> pain in the ... So you should consider if Graphviz worths the efforts. 
> If you find a GTK or Qt library that doing approximately same, that 
> would be a wiser choice, IMO. 
> 
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de

Many thanks for your prompt response and comments Dmitry; they are well appreciated with some of the contents somewhat expected.
I think that I misused the term " Python library"; I think "Python module" is what I should have used.
In this context, in Python, is a module a script?  I'll investigate this.
So I need to see if I can "can load it and  once loaded call (interpret) functions from the module".
This seems to the approach that I need to try. 
Your comment regarding Graphviz was expected. I used it as an example to provide context and certainly do not intend to actually use it for needed graphics. My plan is to use GTK or write my own Ada code for simpler graphics.
The project that I am embarking on is to use Ada for an on-line course in machine learning that uses Python as its teaching platform. 
The importing that I was contemplating concerns special machine learning Python modules used in the course.
Of course, the alternative is for me to translate the Python modules into Ada which is something I've done in the past; generally, in my opinion, yielding much better and more readable code.
Again, thanks for your very helpful comments which, hopefully, have focused my mind on the way ahead.

Regarding your comment that "Python is a huge mess" and my own opinion of Python; I am mortified that Python seems to have become the standard language for teaching computer programming and, particularly, that it seems to be the choice of leading university computer science courses.
It seems that the old well-established rules of quality computer program design have been completely abandoned by these institutions.

Best regards,
Roger Mc Murtrie

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04  7:36 Import Python library into an Ada package? Roger Mc
  2020-12-04 10:23 ` Dmitry A. Kazakov
@ 2020-12-04 13:22 ` Niklas Holsti
  2020-12-04 13:41   ` gautier...@hotmail.com
  2020-12-04 18:32   ` Björn Lundin
  2020-12-04 21:12 ` Per Sandberg
       [not found] ` <f185d71f-2217-4e1f-b6bc-bd854738999an@googlegroups.com>
  3 siblings, 2 replies; 21+ messages in thread
From: Niklas Holsti @ 2020-12-04 13:22 UTC (permalink / raw)


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.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 13:22 ` Niklas Holsti
@ 2020-12-04 13:41   ` gautier...@hotmail.com
  2020-12-04 18:32   ` Björn Lundin
  1 sibling, 0 replies; 21+ messages in thread
From: gautier...@hotmail.com @ 2020-12-04 13:41 UTC (permalink / raw)


As a side note, there is a cool utility called DePlo ( https://sites.google.com/site/depplot/ , sources here : https://launchpad.net/deplo ) that creates a dependency graph of Ada units from the .ali files that GNAT produces when building a project.
This graph is in the Graphviz's DOT format.
And indeed, graphviz is not specific to Python. The sources are in C, and the Web site mentions bindings to: guile, perl, python, ruby, C#, tcl .

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 11:37   ` Roger Mc
@ 2020-12-04 13:55     ` Simon Wright
  0 siblings, 0 replies; 21+ messages in thread
From: Simon Wright @ 2020-12-04 13:55 UTC (permalink / raw)


Roger Mc <rogermcm2@gmail.com> writes:

> Regarding your comment that "Python is a huge mess" and my own opinion
> of Python; I am mortified that Python seems to have become the
> standard language for teaching computer programming and, particularly,
> that it seems to be the choice of leading university computer science
> courses.

I'd certainly agree that interfacing to Python from Ada is a huge mess
(specifically, unsupported hand management of garbage collection, as you
have to do if invoking Python objects).

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 13:22 ` Niklas Holsti
  2020-12-04 13:41   ` gautier...@hotmail.com
@ 2020-12-04 18:32   ` Björn Lundin
  2020-12-04 19:08     ` Roger Mc
  2020-12-04 21:09     ` Dmitry A. Kazakov
  1 sibling, 2 replies; 21+ messages in thread
From: Björn Lundin @ 2020-12-04 18:32 UTC (permalink / raw)


Den 2020-12-04 kl. 14:22, skrev Niklas Holsti:
> 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.

And if you really just want to draw graphs - and can use another tool - 
gnuplot can be controlled by spawning it and send commands on stdin via 
pipes.


-- 
Björn

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 18:32   ` Björn Lundin
@ 2020-12-04 19:08     ` Roger Mc
  2020-12-04 19:40       ` Niklas Holsti
  2020-12-04 21:09     ` Dmitry A. Kazakov
  1 sibling, 1 reply; 21+ messages in thread
From: Roger Mc @ 2020-12-04 19:08 UTC (permalink / raw)


On Saturday, December 5, 2020 at 5:33:00 AM UTC+11, björn lundin wrote:
> Den 2020-12-04 kl. 14:22, skrev Niklas Holsti: 
> > 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.
> And if you really just want to draw graphs - and can use another tool - 
> gnuplot can be controlled by spawning it and send commands on stdin via 
> pipes. 
> 
> 
> -- 
> Björn
Thanks for the many helpful comments regarding Graphviz.
I shall certainly consider using these for my project.
I'm not sure what is meant by "automatically laid-out graphs".
Roger

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 19:08     ` Roger Mc
@ 2020-12-04 19:40       ` Niklas Holsti
  2020-12-04 21:25         ` Björn Lundin
  0 siblings, 1 reply; 21+ messages in thread
From: Niklas Holsti @ 2020-12-04 19:40 UTC (permalink / raw)


On 2020-12-04 21:08, Roger Mc wrote:
> On Saturday, December 5, 2020 at 5:33:00 AM UTC+11, björn lundin wrote:
>> Den 2020-12-04 kl. 14:22, skrev Niklas Holsti:
>>> 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.
>> And if you really just want to draw graphs - and can use another tool -
>> gnuplot can be controlled by spawning it and send commands on stdin via
>> pipes.
>>
>>
>> -- 
>> Björn
> Thanks for the many helpful comments regarding Graphviz.
> I shall certainly consider using these for my project.
> I'm not sure what is meant by "automatically laid-out graphs".


Graphviz and in particular its "dot" tool are used to draw nice views of 
"graphs" that consist of nodes and arcs, not the simple kind of x-y plot 
"graph" that we so often look at nowadays -- showing how the pandemic 
curve is growing or flattening -- and that, AIUI, gnuplot is mostly used 
for.

In the "dot" language, one defines a node-and-arc graph by listing and 
naming all the nodes and then listing all the arcs from one node to 
another. The "dot" tool performs an automatic lay-out that places the 
nodes on the two-dimensional plane (= drawing surface) so that few arcs 
cross other arcs, and most arcs connect nodes that are close together -- 
in other words, a a visually clear and neat node-arc graphic instead of 
an arbitrary spaghetti.

The "dot" language and tool provide many ways to control the lay-out and 
to annotate it. Very flexible.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 18:32   ` Björn Lundin
  2020-12-04 19:08     ` Roger Mc
@ 2020-12-04 21:09     ` Dmitry A. Kazakov
  2020-12-04 21:15       ` Roger Mc
  1 sibling, 1 reply; 21+ messages in thread
From: Dmitry A. Kazakov @ 2020-12-04 21:09 UTC (permalink / raw)


On 2020-12-04 19:32, Björn Lundin wrote:
> Den 2020-12-04 kl. 14:22, skrev Niklas Holsti:
>> 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.
> 
> And if you really just want to draw graphs - and can use another tool - 
> gnuplot can be controlled by spawning it and send commands on stdin via 
> pipes.

If you want to build a GUI you can use Cairo. It has all necessary stuff 
for vector graphics. E.g. this one uses GtkAda Cairo bindings:

    http://www.dmitry-kazakov.de/ada/aicwl.htm

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04  7:36 Import Python library into an Ada package? Roger Mc
  2020-12-04 10:23 ` Dmitry A. Kazakov
  2020-12-04 13:22 ` Niklas Holsti
@ 2020-12-04 21:12 ` Per Sandberg
  2020-12-04 21:19   ` Roger Mc
       [not found] ` <f185d71f-2217-4e1f-b6bc-bd854738999an@googlegroups.com>
  3 siblings, 1 reply; 21+ messages in thread
From: Per Sandberg @ 2020-12-04 21:12 UTC (permalink / raw)


gnatcoll.python + a lot of binding work

/P


On 04/12/2020 08:36, Roger Mc wrote:
> Is it possible to import a Python library, such as graphviz, into an Ada package?
> So far I have only been able to find information on exporting Ada to Python.
> 

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 21:09     ` Dmitry A. Kazakov
@ 2020-12-04 21:15       ` Roger Mc
  0 siblings, 0 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-04 21:15 UTC (permalink / raw)


On Saturday, December 5, 2020 at 8:09:53 AM UTC+11, Dmitry A. Kazakov wrote:
> On 2020-12-04 19:32, Björn Lundin wrote: 
> > Den 2020-12-04 kl. 14:22, skrev Niklas Holsti: 
> >> 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. 
> > 
> > And if you really just want to draw graphs - and can use another tool - 
> > gnuplot can be controlled by spawning it and send commands on stdin via 
> > pipes.
> If you want to build a GUI you can use Cairo. It has all necessary stuff 
> for vector graphics. E.g. this one uses GtkAda Cairo bindings: 
> 
> http://www.dmitry-kazakov.de/ada/aicwl.htm
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de
Thanks Dmitry,
   I am considering using aicwl where appropriate.
Regards,
Roger

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 21:12 ` Per Sandberg
@ 2020-12-04 21:19   ` Roger Mc
  2020-12-04 23:17     ` Dmitry A. Kazakov
  0 siblings, 1 reply; 21+ messages in thread
From: Roger Mc @ 2020-12-04 21:19 UTC (permalink / raw)


On Saturday, December 5, 2020 at 8:12:14 AM UTC+11, persan....@gmail.com wrote:
> gnatcoll.python + a lot of binding work 
> 
> /P
> On 04/12/2020 08:36, Roger Mc wrote: 
> > Is it possible to import a Python library, such as graphviz, into an Ada package? 
> > So far I have only been able to find information on exporting Ada to Python. 
> >
I have been trying to figure out how to use gnatcoll.python.
Unfortunately it doesn't seem to provide any supporting documentation.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 19:40       ` Niklas Holsti
@ 2020-12-04 21:25         ` Björn Lundin
  2020-12-04 23:33           ` Roger Mc
  0 siblings, 1 reply; 21+ messages in thread
From: Björn Lundin @ 2020-12-04 21:25 UTC (permalink / raw)


Den 2020-12-04 kl. 20:40, skrev Niklas Holsti:
> 
> In the "dot" language, one defines a node-and-arc graph by listing and 
> naming all the nodes and then listing all the arcs from one node to 
> another. The "dot" tool performs an automatic lay-out that places the 
> nodes on the two-dimensional plane (= drawing surface) so that few arcs 
> cross other arcs, and most arcs connect nodes that are close together -- 
> in other words, a a visually clear and neat node-arc graphic instead of 
> an arbitrary spaghetti.

Very interesting - I think I'll spend some time with its docs - thanks

-- 
Björn

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 21:19   ` Roger Mc
@ 2020-12-04 23:17     ` Dmitry A. Kazakov
  2020-12-04 23:42       ` Roger Mc
  0 siblings, 1 reply; 21+ messages in thread
From: Dmitry A. Kazakov @ 2020-12-04 23:17 UTC (permalink / raw)


On 2020-12-04 22:19, Roger Mc wrote:
> On Saturday, December 5, 2020 at 8:12:14 AM UTC+11, persan....@gmail.com wrote:
>> gnatcoll.python + a lot of binding work
>>
>> /P
>> On 04/12/2020 08:36, Roger Mc wrote:
>>> Is it possible to import a Python library, such as graphviz, into an Ada package?
>>> So far I have only been able to find information on exporting Ada to Python.
>>>
> I have been trying to figure out how to use gnatcoll.python.
> Unfortunately it doesn't seem to provide any supporting documentation.

What about this:

    https://docs.adacore.com/gnatcoll-docs/scripting.html

I have a rudimentary Python bindings independent on GNATColl, which I 
use to run Python scripts from Ada. They were designed to load Python 
dynamically, I did not want to make the application dependent on Python 
installed. If you want, you can use them as a template. There is no 
documentation, but the code using them. But as I said, better not... (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 21:25         ` Björn Lundin
@ 2020-12-04 23:33           ` Roger Mc
  0 siblings, 0 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-04 23:33 UTC (permalink / raw)


On Saturday, December 5, 2020 at 8:25:10 AM UTC+11, björn lundin wrote:
> Den 2020-12-04 kl. 20:40, skrev Niklas Holsti: 
> > 
> > In the "dot" language, one defines a node-and-arc graph by listing and 
> > naming all the nodes and then listing all the arcs from one node to 
> > another. The "dot" tool performs an automatic lay-out that places the 
> > nodes on the two-dimensional plane (= drawing surface) so that few arcs 
> > cross other arcs, and most arcs connect nodes that are close together -- 
> > in other words, a a visually clear and neat node-arc graphic instead of 
> > an arbitrary spaghetti.
> Very interesting - I think I'll spend some time with its docs - thanks 
> 
> -- 
> Björn

I tried using pdf on a small project.
Great result.
I tried on a complex project.
A real mess.
Then tried using ps with the complex project.
Great result when viewed with PostView.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 23:17     ` Dmitry A. Kazakov
@ 2020-12-04 23:42       ` Roger Mc
  2020-12-04 23:57         ` Roger Mc
  2020-12-05  9:38         ` Dmitry A. Kazakov
  0 siblings, 2 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-04 23:42 UTC (permalink / raw)



> What about this: 
> 
> https://docs.adacore.com/gnatcoll-docs/scripting.html 
> 
> I have a rudimentary Python bindings independent on GNATColl, which I 
> use to run Python scripts from Ada. They were designed to load Python 
> dynamically, I did not want to make the application dependent on Python 
> installed. If you want, you can use them as a template. There is no 
> documentation, but the code using them. But as I said, better not... (:-))
> -- 
> Regards, 
> Dmitry A. Kazakov 
> http://www.dmitry-kazakov.de

I would really appreciate seeing your "rudimentary Python bindings ".
In the meantime I must study gnatcoll-docs/scripting.html more closely.
I have made a start using an example I found on the web but unfortunately it crashes with an EXC_SOFTWARE, Software generated exception which I think may be due to an invalid process descriptor.
Thanks,
Roger

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 23:42       ` Roger Mc
@ 2020-12-04 23:57         ` Roger Mc
  2020-12-05  0:13           ` Roger Mc
  2020-12-05  9:38         ` Dmitry A. Kazakov
  1 sibling, 1 reply; 21+ messages in thread
From: Roger Mc @ 2020-12-04 23:57 UTC (permalink / raw)


On Saturday, December 5, 2020 at 10:42:26 AM UTC+11, Roger Mc wrote:
> > What about this: 
> > 
> > https://docs.adacore.com/gnatcoll-docs/scripting.html 
> > 
> > I have a rudimentary Python bindings independent on GNATColl, which I 
> > use to run Python scripts from Ada. They were designed to load Python 
> > dynamically, I did not want to make the application dependent on Python 
> > installed. If you want, you can use them as a template. There is no 
> > documentation, but the code using them. But as I said, better not... (:-)) 
> > -- 
> > Regards, 
> > Dmitry A. Kazakov 
> > http://www.dmitry-kazakov.de
> I would really appreciate seeing your "rudimentary Python bindings ". 
> In the meantime I must study gnatcoll-docs/scripting.html more closely. 
> I have made a start using an example I found on the web but unfortunately it crashes with an EXC_SOFTWARE, Software generated exception which I think may be due to an invalid process descriptor. 
> Thanks, 
> Roger

Some good news.
I now have my example working.
The problem was simply not specifying the correct path to my Python module!

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 23:57         ` Roger Mc
@ 2020-12-05  0:13           ` Roger Mc
  0 siblings, 0 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-05  0:13 UTC (permalink / raw)


On Saturday, December 5, 2020 at 10:57:54 AM UTC+11, Roger Mc wrote:
> On Saturday, December 5, 2020 at 10:42:26 AM UTC+11, Roger Mc wrote: 
> > > What about this: 
> > > 
> > > https://docs.adacore.com/gnatcoll-docs/scripting.html 
> > > 
> > > I have a rudimentary Python bindings independent on GNATColl, which I 
> > > use to run Python scripts from Ada. They were designed to load Python 
> > > dynamically, I did not want to make the application dependent on Python 
> > > installed. If you want, you can use them as a template. There is no 
> > > documentation, but the code using them. But as I said, better not... (:-)) 
> > > -- 
> > > Regards, 
> > > Dmitry A. Kazakov 
> > > http://www.dmitry-kazakov.de 

gnatcoll-docs/scripting.html  seems mostly concerned with exporting Ada resources.
I can't find information in it for importing Python modules into Ada.
Importing is briefly addressed by Ada Gem #54: Scripting Capabilities in GNAT (Part 2).

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
  2020-12-04 23:42       ` Roger Mc
  2020-12-04 23:57         ` Roger Mc
@ 2020-12-05  9:38         ` Dmitry A. Kazakov
  1 sibling, 0 replies; 21+ messages in thread
From: Dmitry A. Kazakov @ 2020-12-05  9:38 UTC (permalink / raw)


On 2020-12-05 00:42, Roger Mc wrote:

> I would really appreciate seeing your "rudimentary Python bindings ".

Download sources of this:

    http://www.dmitry-kazakov.de/ada/max_home_automation.htm

The project is large. Only these packages are related to Python:

1. Py is the bindings

2. Py.Load_Python_Library is an OS-dependent part for loading Python 
dynamically from a DLL (Linux or Windows)

3. Py.ELV_MAX_Cube is an implementation of a Python module in Ada. I.e. 
calling Ada from Python.

4. MAX_Control_Page contains a task that periodically runs Python 
script. I.e. calling Python from Ada.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: Import Python library into an Ada package?
       [not found] ` <f185d71f-2217-4e1f-b6bc-bd854738999an@googlegroups.com>
@ 2020-12-16 23:58   ` Roger Mc
  0 siblings, 0 replies; 21+ messages in thread
From: Roger Mc @ 2020-12-16 23:58 UTC (permalink / raw)


On Sunday, December 13, 2020 at 1:38:07 AM UTC+11, 196...@googlemail.com wrote:
> [,,,] 
> 
> I'm late to the party as usual. 
> 
> Why not just code it in SVG? It is very easy and just plain XML.
I've no idea how to do this.

In any event I've decided to bite the bullet and try and port the python code to Ada.
Thanks everyone for your valuable advice. Much appreciated.

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2020-12-16 23:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-04  7:36 Import Python library into an Ada package? Roger Mc
2020-12-04 10:23 ` Dmitry A. Kazakov
2020-12-04 11:37   ` Roger Mc
2020-12-04 13:55     ` Simon Wright
2020-12-04 13:22 ` Niklas Holsti
2020-12-04 13:41   ` gautier...@hotmail.com
2020-12-04 18:32   ` Björn Lundin
2020-12-04 19:08     ` Roger Mc
2020-12-04 19:40       ` Niklas Holsti
2020-12-04 21:25         ` Björn Lundin
2020-12-04 23:33           ` Roger Mc
2020-12-04 21:09     ` Dmitry A. Kazakov
2020-12-04 21:15       ` Roger Mc
2020-12-04 21:12 ` Per Sandberg
2020-12-04 21:19   ` Roger Mc
2020-12-04 23:17     ` Dmitry A. Kazakov
2020-12-04 23:42       ` Roger Mc
2020-12-04 23:57         ` Roger Mc
2020-12-05  0:13           ` Roger Mc
2020-12-05  9:38         ` Dmitry A. Kazakov
     [not found] ` <f185d71f-2217-4e1f-b6bc-bd854738999an@googlegroups.com>
2020-12-16 23:58   ` Roger Mc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox