Jump to content

pyscripter

Members
  • Content Count

    1001
  • Joined

  • Last visited

  • Days Won

    64

Posts posted by pyscripter


  1. The IPC unit based on named pipes created  by Russell Libby in 2003 and updated by @FPiette is worth checking.

    Blog article: Behind the connection: Inter Process Communication Using Pipes (francois-piette.blogspot.com)

    Source code: OverByte - Blog Source Code

     

    Named pipes in overlapped mode are super efficient and faster than sockets.  See Synchronous and Overlapped Pipe I/O - Win32 apps | Microsoft Learn.  See also I/O Completion Ports - Win32 apps | Microsoft Learn.  I have contributed such a solution to the python library RPyC and it beats the socket based IPC by a large margin.   The downside is that it is Windows only.


  2. On 1/14/2023 at 8:12 PM, uefi said:

    Hello, I can not get the result of the script execution instead of the result I get: 

    value=none

    What did you expect to get?

    Demo03 shows you how to use TPythonDelphiVar.


  3. Call you delphi module say "delphimodule"  and in your script:

     

    import delphimodule

    print(delphimodule.QUANTITY);

     

    or 

    from delphimodule import QUANTITY

    print(QUANTITY)

     

    Please look at the demos, before asking questions here and do yourself a favour.  Do watch the two video tutorials. It is only two hours viewing and will save you masses of time if you plan to do any serious work with P4D.


  4. 10 minutes ago, Juan C.Cilleruelo said:

     PyEngine.LoadDll;

          p := PyEngine.PyLong_FromLong(1);
          PyModule.SetVar('QUANTITY', p);
          PyEngine.Py_DecRef(p);

          PyEngine.IO := FPythonIO;

    Set PyEngine.IO before you call LoadDLL

     

    Redirection is setup by TPythonEngine.Initialize, which is called by LoadDLL.


  5. P4D works fine with miniconda distributions.  Read FindingPython · pyscripter/python4delphi Wiki (github.com) for details.

    1 hour ago, superc said:

    I Download embeddable version of Python 3.10.8 and copy *.dll and python310.zip

    There is no need to do that.  If on the other hand you want to deploy python with your application, have a look at this project Embarcadero/PythonEnviroments: Components to simplify the deployment for Python environments for Delphi applications using Python4Delphi. (github.com)

     


  6. 10 minutes ago, programmerdelphi2k said:

    just unchecking "Inherit" (on Event) does not works?

    If you uncheck the event inherit in derived configurations, then you would need to define it again.

    The question is why Delphi replicates an event defined for All Configurations for each configuration and how you can prevent that. 

×