1

Topic: Delphi + Python + Linux

Greetings to all.
With the advent of version 10.2 we can    under Linux if to connect
CrossVCL or FMXLinux that and  with GUI th.
And is breaking that possibility to all   to connect Python?
under Linux th in service or in GUI  to work with Python scripts?
Like as though there is  "Python for Delphi (P4D)", but it like for VCL...
Who  dug in  the side?
WBR
Janex

2

Re: Delphi + Python + Linux

In Linux there are no services, there only demons. To demons are not necessary neither VCL, nor FMX, so without
Differences on what any library is ground.

3

Re: Delphi + Python + Linux

Dimitry Sibiryakov wrote:

In Linux there are no services, there only demons. To demons are not necessary neither VCL, nor FMX, so without
Differences on what any library is ground.

Yes, demons, I know, not so named smile
And to , the question acts in film, wrote  that in the code  "Python for Delphi (P4D)";
There at once it is visible that the code and for Linux it is written...

4

Re: Delphi + Python + Linux

Janex;
In api a python some functions are literally, it is possible to pick up also an engine and the unit to write, anything especially difficult
The only thing at  with ccall any problems were (Py_BuildValue, on versions is higher 7 did not check) therefore used fpc

5

Re: Delphi + Python + Linux

I left as a result from it P4D.
Which most part  basically is a lot of the problems.

6

Re: Delphi + Python + Linux

There is an experience of binding Lua and Delphi
Now I work over binding of functions on RTTI. That is everyone reference, TMethod, a method of the interface and it is simple class methods - have RTTI where the function name, each parameter, the agreement on a call is described. All can be pulled it from  language. A similar functional for properties.
To what I tell it. There will be a will - it is possible to unite efforts and to make analog P4D.

7

Re: Delphi + Python + Linux

kealon (Ruslan) wrote:

Janex;
In api a python some functions are literally, it is possible to pick up also an engine and the unit to write, anything especially difficult
The only thing at  with ccall any problems were (Py_BuildValue, on versions is higher 7 did not check) therefore used fpc

Yes well...
The pair of hundreds  looked python.dll and python36.dll, there to everyone at functions...

8

Re: Delphi + Python + Linux

Janex wrote:

it is passed...
Yes well...
The pair of hundreds  looked python.dll and python36.dll, there to everyone at functions...

it is service for base types in the core. Never all this array was useful, and the problem to add one two functions?
Here, for example, engine start
[spoiler]

program TestAPI;
{$mode objfpc} {$H +}
uses
Classes, SLEParser, SolverDef, SolverLib, MyPyEngine
{you can add units after this};
var SL:TStringList;
begin
Py_SetProgramName (PChar (ParamStr (0)));/* optional but recommended */
Py_Initialize ();
initMyLibs;
SL: = TStringList. Create;
try
SL.LoadFromFile (' SolverTest.py ');
//PyRun_SimpleString (' from time import time, ctime'#13#10'print "Today is", ctime (time() ' #13#10);
PyRun_SimpleString (PChar (SL.Text));
finally
SL.Free;
end;
Py_Finalize ();
end.

[/spoiler]

9

Re: Delphi + Python + Linux

kealon (Ruslan);
And from where   an example?
It is possible where that to download on more examples, and that with one example  I will drive
In  kitchen, and that  is necessary to me that from a script it would be possible  to pull,
the such:
MyDelphiLabelOnForm. Text = ' blabla'
Or even to load a script in an engine and to fulfill what that one function...

10

Re: Delphi + Python + Linux

It seems to me, I such examples with   saw about 15 years ago in the same P4D or that there then was.
At me a question typical for Russian forums. And what for the Python is necessary? It seems to me, there are more suitable variants. Type FastScript or the same Lua. I for some reason had impression of some  this sheaf. And separately neither to the Python nor to Delfi of claims is not present, and here in a sheaf - nonsense any.

11

Re: Delphi + Python + Linux

Janex;
 
Titles it is possible from this PFD4 to take

12

Re: Delphi + Python + Linux

Alexander A. Sak;
Why a python...
The matter is that that I do that,  I hope (all  so  smile), will be wide  on all full-sphere smile
And if  to look at popularity  delfi/paskal largely concedes to a python, to that  as speak;
It  in training.
I with pleasure would do on FastScript or PaxCompiler-e, but I am afraid of many  frightens off.
More likely this I will do the project that worked both on a python and on FastScript while only  with what to begin...

13

Re: Delphi + Python + Linux

If to dance from popularity to you on Java plug-ins it is necessary to do. smile

14

Re: Delphi + Python + Linux

I would tell, on JavaScript.
By the way, somewhere saw implementation JS on Delfi (or FPC).

15

Re: Delphi + Python + Linux

Alexander A. Sak wrote:

I would tell, on JavaScript.
By the way, somewhere saw implementation JS on Delfi (or FPC).

At me at the most similar implementation in a software is.
But the most popular language ostensibly simple Java.

16

Re: Delphi + Python + Linux

rgreat wrote:

But the most popular language ostensibly simple Java.

You buy here, ,  SAN-Switch from HP... For a half-million of the wooden.... And there the configurator is made in the form of a Java-applet which it is possible to launch only from under Internet Explorer', and is not higher 6 the version for what it is necessary to lift separate  on Windows XP... Yes there would be it wood, such popularity!

17

Re: Delphi + Python + Linux

I did not tell that Java - the best language. I told that it the most popular.:-D

18

Re: Delphi + Python + Linux

alekcvp;
But java and tiobe heats smile))
Janex': what for Delphi generally it was necessary? Would write at once on a python if to heart so it is lovely?

19

Re: Delphi + Python + Linux

Janex wrote:

there at once it is visible that the code and for Linux it is written...

Only it for  and , and for delphi for linux it does not go.

20

Re: Delphi + Python + Linux

Kazantsev Alexey wrote:

it is passed...
Only it for  and , and for delphi for linux it does not go.

Well...  already noted sad

21

Re: Delphi + Python + Linux

makhaon wrote:

alekcvp;
But java and tiobe heats smile))
Janex': what for Delphi generally it was necessary? Would write at once on a python if to heart so it is lovely?

On  I write years 20, and   which that language is better , and on
Python for scripts I look  that that more popularly than

22

Re: Delphi + Python + Linux

Janex wrote:

at a python for scripts I look from that is more popular than

If the program useful, it will be  though on what. And if not so useful, on what will not be. If to put sensible examples  as a documentation part - people understand.

23

Re: Delphi + Python + Linux

Janex wrote:

I with pleasure would do on FastScript or PaxCompiler-e, but I am afraid of many  frightens off.
More likely this I will do the project that worked both on a python and on FastScript while only  with what to begin...

PaxCompiler categorically wood, for . If it finish to mind and A-Pax will be normal... But that when still will be.
FastScript - not .
From 10 + experts PascalScript proved to be as stable and licked very much. Much that is not able, but that is - works perfectly well.

24

Re: Delphi + Python + Linux

Vizit0r wrote:

From 10 + experts PascalScript proved to be as stable and licked very much. Much that is not able, but that is - works perfectly well.

Its some decisions nonplus me, as well as some moments of the source code. If you about RemObjects.
From this that is quickly recalled: what for made so that for classes which are exported to a script, it is possible setter for property to assign directly, and for  - it is necessary to make a wrapper since it on-default is made in the form of procedure. Why not to make in the form of function as in  - it is not clear.

25

Re: Delphi + Python + Linux

alekcvp wrote:

it is passed...
Its some decisions nonplus me, as well as some moments of the source code. If you about RemObjects.
From this that is quickly recalled: what for made so that for classes which are exported to a script, it is possible setter for property to assign directly, and for  - it is necessary to make a wrapper since it on-default is made in the form of procedure. Why not to make in the form of function as in  - it is not clear.

.