Jump to content

pyscripter

Members
  • Content Count

    920
  • Joined

  • Last visited

  • Days Won

    56

Everything posted by pyscripter

  1. pyscripter

    Tool to inspect properties at run-time?

    MahdiSafsafi/zControls: zControls (github.com)
  2. 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)
  3. 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.
  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. The OleSetClipboardData documentation claims that the Clipboard implements delayed rendering, meaning that it renders a given format of the IDataObject implementation, only when the format is actually requested. My DataObject implements CF_UNICODETEXT and CF_HTML formats. As soon as I call OleSetClipboardData both formats are rendered. Any idea why is that? How can one implement delayed (lazy) rendering of clipboard formats?
  16. 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.
  17. pyscripter

    OleSetClipboardData and delayed rendering

    Thanks @Anders Melander. It could be the Windows 10 multi-device clipboard that results in this, or else some formats like CF_UNICODETEXT are translated automatically say to CF_TEXT for compatibility with the OLE 1.0 Clipboard.
  18. This does not work in per-Monitor DPI-aware applications.
  19. pyscripter

    InputQuery texts

    There is a corresponding event OnReceiveUniData. Which is used is based on IO.UnicodeIO, which by default is true.
  20. pyscripter

    InputQuery texts

    function TPythonGUIInputOutput.ReceiveData : AnsiString; Var S : string; begin if Assigned( FOnReceiveData ) then Result := inherited ReceiveData else begin InputQuery( 'Query from Python', 'Enter text', S); Result := AnsiString(S); end; end; You can handle the OnReceiveData event and respond in whatever way you like.
  21. MahdiSafsafi/zControls: zControls (github.com)
  22. pyscripter

    LIBSUFFIX Again

    Starting from Syndey update 2, I am experiencing the folowing: Open in the IDE packages with no LIBSUFFIX or a LIBSUFFIX different that auto. LIBSUFFIX 270 is added automatically and the package is named accordingly Open project options and remove the LIBSUFFIX has no effect. Next time you open the project options is back there. Removing the LIBSUFFIX directive from the package source also has no effect on the package name. It seems that the IDE is enforcing the LIBSUFFIX 270. I have not found a workaround. You can still compile the packages from the command-line though. Am I missing something?
  23. pyscripter

    LIBSUFFIX Again

    YES INDEED. That explains the mystery. It almost drove me crazy.
  24. pyscripter

    LIBSUFFIX Again

    32bit VCL Windows. I have the issue with both runtime and design time packages. Try to open for example the D10_4 packages of github.com/EtheaDev/SVGIconImageList
  25. pyscripter

    SetLength TBytes Memory Leak

    FYI Added stCleanRawStack JclStackTrackingOptions option that eliminates … · project-jedi/jcl@4867c10 (github.com)
×