本帖最后由 冥界3大法王 于 2020-10-25 12:31 编辑
PythonEngine1.APIVersion := StrToInt(p1);
PythonEngine1.DllName := p2;
PythonEngine1.DllPath := p3;
PythonEngine1.UseLastKnownVersion := StrToBool(p4);
PythonEngine1.RegVersion := p5;
以上几句没报错,但也没有发挥到作用,哪里有问题呢?
inifile.free;
然后,我不死心,又写了个更简单的的程序来测试:
果然丁点作用不起。
[Delphi] 纯文本查看 复制代码 unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs,
Vcl.ComCtrls, Vcl.ToolWin, sToolBar, System.ImageList, Vcl.ImgList,
acAlphaImageList, Vcl.StdCtrls, sRichEdit, sPageControl, Vcl.ExtCtrls, sPanel,
SynEditHighlighter, SynEditCodeFolding, SynHighlighterPython, PythonEngine,
PythonGUIInputOutput, SynEdit, SynMemo, sButton, sEdit, sLabel;
type
TForm1 = class(TForm)
PythonEngine1: TPythonEngine;
PythonGUIInputOutput1: TPythonGUIInputOutput;
SynPythonSyn1: TSynPythonSyn;
sPanel21: TsPanel;
sPageControl2: TsPageControl;
sTabSheet10: TsTabSheet;
BiJi_ChengMan: TsPanel;
SSJ_Top: TsPanel;
sRichEdit2: TsRichEdit;
SSJ_Images: TsAlphaImageList;
sToolBar1: TsToolBar;
ToolButton1: TToolButton;
ToolButton2: TToolButton;
ToolButton3: TToolButton;
sEdit1: TsEdit;
sEdit2: TsEdit;
sEdit3: TsEdit;
sButton1: TsButton;
SynMemo1: TSynMemo;
sLabel1: TsLabel;
sLabel2: TsLabel;
sLabel3: TsLabel;
procedure ToolButton1Click(Sender: TObject);
procedure sButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.sButton1Click(Sender: TObject);
begin
PythonEngine1.DllName := sEdit1.Text;
PythonEngine1.DllPath := sEdit2.Text;
PythonEngine1.RegVersion := sEdit3.Text;
end;
procedure TForm1.ToolButton1Click(Sender: TObject);
begin
PythonEngine1.ExecStrings(SynMemo1.Lines);
end;
end.
|