Lazarus
Programming => Packages and Libraries => Ported from Delphi/Kylix => Topic started by: docwat on August 27, 2018, 12:51:44 pm
-
Hi,
I am trying to install python4delphi into Lazarus. The download .zip is full of .dpg rather than .lpg files and a number of .pas files. I have no experience of porting Delphi packages.
If anyone could point me to the starting line that would be great !
Many thanks,
Docwat
-
Have you tried this: https://github.com/Alexey-T/Python-for-Lazarus/tree/master/python4lazarus
I think there is even a version available in Online Package Manager
Did you use google? There is even a wiki page: http://wiki.freepascal.org/Using_Python_in_Lazarus_on_Windows/Linux
-
Many thank Soersen3, I will recheck these resources. So far I have not found a detailed route to installing the python4delphi package. I must be missing something very simple.
Thanks,
Docwat
-
Many thank Soersen3, I will recheck these resources. So far I have not found a detailed route to installing the python4delphi package. I must be missing something very simple.
Thanks,
Docwat
Yes, the simple thing is you can't install delphi packages in Lazarus, because the format differs. Python4Lazarus is a straight port, though, so use that.
The author is on this forum.
-
Hi both Soersen and Thappy,
Very many thanks - I was unaware that there was a python4lazarus - That explains my problem
much appreciated,
Docwat
-
Whilst Python4Lazarus installs, I am having difficulty running the simple test prog below. The program accepts an input script print(2+2) however the PythonGUIInputOutput module simple clears the TREDIT output Tmemo. This suggests that the PythonEngine1 is outputting something to the PGIO which overrides the TREDIT with nulls. Additionally if the input script is miss-entered as print(2+A) the unit ends with the expected exception.
My windows system is 8.1 32bit and Python version 3.7. With the PythonEngine correctly showing script errors and the PythonGUIInputOutput resopnding, can it be that Python3.7 does not work in this environment ?
I would be grateful for any comments.
Thanks Docwat
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, SynHighlighterPython, Forms, Controls, Graphics,
Dialogs, StdCtrls, PythonGUIInputOutput, PythonEngine;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Label1: TLabel;
Label2: TLabel;
Memo1: TMemo;
TREDIT: TMemo;
PythonEngine1: TPythonEngine;
PythonGUIInputOutput1: TPythonGUIInputOutput;
procedure Button1Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
begin
PythonEngine1.ExecStrings(Memo1.Lines);
end;
end.
-
I find it P4L was responding next line down in TMemo which was off my component height !
Working fine !
DocWat
-
Python4Lazarus has Lazarus demo app (Edit+Memo), check it.