Skip to content

Running python code in Delphi threads issue #458

Closed
@KhurshedUlugov

Description

@KhurshedUlugov

It's a continuation of a theme #457

Unfortunately, nothing works. None of the methods given in the article (https://github.com/pyscripter/python4delphi/wiki/PythonThreads#tpythonthread-properties). There is simply no response. I have logging, but nothing is written in the log.

What am I doing wrong? Python embedded version is 3.8. Delphi 11.3

Here is my code:

    ThreadPythonExec(
    procedure
    begin
      GetPythonEngine.ExecFile(PyFileName);
    end{, nil, false, emNewInterpreter});

    Task := TTask.Create(
        procedure
        var
          Py: IPyEngineAndGIL;
        begin
          Py := SafePyEngine;
          Py.PythonEngine.ExecFile(PyFileName);
        end);
    Task.Start;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions