Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


pyscripter last won the day on July 20

pyscripter had the most liked content!

Community Reputation

342 Excellent


Technical Information

  • Delphi-Version
    Delphi 10.3 Rio

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. pyscripter

    Tool to inspect properties at run-time?

    MahdiSafsafi/zControls: zControls (github.com)
  2. pyscripter

    Can not compile Python_D.dpk Ver. xe2

    The query is handled in xe2 bpl installation problem , need help · Issue #313 · pyscripter/python4delphi (github.com) Contributions from XE2 users are welcome.
  3. pyscripter

    New Community Edition

    In case you have not seen it: Delphi & C++Builder Community Editions Now Available in Version 10.4.2! (embarcadero.com)
  4. pyscripter

    Running Python scripts in threads

    Hard to answer this question in a meaningful way, since it depends a great deal on what you are trying to do. In general though: you can code performance critical computations in Delphi. See python4delphi/Tutorials/Webinar I at master · pyscripter/python4delphi (github.com) for an example of speeding up python code 60 times doing this. use python modules coded in C (or other compiled languages) that can spread computations to multiple cores.
  5. pyscripter

    Running Python scripts in threads

    class procedure TPythonThread.Py_Begin_Allow_Threads; You also need to call Py_End_Allow_Threads when all threads finish.
  6. pyscripter

    Running Python scripts in threads

    You need to call PyBeginAllowThreads in the main thread.
  7. pyscripter

    Unable to compile P4D with Delphi 10.4 for Linux64

    Thanks.. It is now fixed.
  8. pyscripter

    Unable to compile P4D with Delphi 10.4 for Linux64

    FProgramName should have a lenght of 0 (empty string) unless you call SetProgramName. Could you please check whether UCS4StringToUnicodeString fails with an empty string? UCS4String is defined as an array of UCS4Char. Could this be a fix? function TPythonEngine.GetProgramName: UnicodeString; begin {$IFDEF POSIX} if Length(FProgramName) = 0 then Result := '' else Result := UCS4StringToUnicodeString(FProgramName); {$ELSE} Result := FProgramName; {$ENDIF} end;
  9. pyscripter

    Unable to compile P4D with Delphi 10.4 for Linux64

    Do you mean? WL[Ι] := UnicodeStringToUCS4String(TempS); Changes committed.
  10. pyscripter

    Unable to compile P4D with Delphi 10.4 for Linux64

    There was a typo which is not fixed {$IFDEF POSIX} PWCharT = PUCS4Char; PPWCharT = PUCS4Char^; WCharTString = UCS4String; {$ELSE} Please try again with the latest. Please report back any further issues, since I have not tested with Linux recently.
  11. There are many Delphi units for doing that e.g. - JCL library in JclSysUtils Execute functions - JVCL JvCreateProcess component and many others
  12. pyscripter

    Enbedded editor, debugging, etc...

    Not quite. You can use PyScripter code as a basis for providing embedded IDE functionality, however that would be non-trivial.
  13. pyscripter

    Xdata Rest server request & Python4Delphi

    I said "after loading" loosely speaking and not "in the OnAfterLoad event". Indeed you can only call Py_Begin_Allow_Threads after the engine is initialized. I have not tested, but you can set AutoFinalize to False and in the OnBeforeUnload do Py_End_Allow_Threads; Finalize; Also probably, skipping the above when the application closes down may not be necessary.
  14. pyscripter

    Xdata Rest server request & Python4Delphi

    Of course it is. If another thread holds the lock, PyGILState_Ensure blocks until the GIL becomes available, i.e. the holding thread calls PyGILState_Release. If more than one threads are waiting for GIL then I think it is assigned of FCFS basis. The automatic switching that you described only applies to threads created with the threading code. All other threads need to get the GIL before executing python code and then release it. Yes you do need to call Py_Begin_Allow_Threads in the main thread. When the python DLL loads, the main thread owns the GIL and it needs to release it before other threads can execute python code.
  15. pyscripter

    OleSetClipboardData and delayed rendering

    I am using OleSetClipboardData with a IDataObject. This does not have any other arguments. And I am not handling WM_RENDERFORMAT or WM_RENDERALLFORMATS. These messages are handled by the OLE clipboard.