Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


pyscripter last won the day on September 23

pyscripter had the most liked content!

Community Reputation

283 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

    PyPy support

  2. pyscripter

    Finding Anaconda distributions of Python

    Have you read https://github.com/pyscripter/python4delphi/wiki/MaskFPUExceptions? There is no need to activate the Anaconda environment. Just read and follow https://github.com/pyscripter/python4delphi/wiki/FindingPython. If you want to work with a specific Conda environment (not the main installation) then you need to specify it as the DLLPATH.
  3. This is an old thread. However I have a question regarding Russell Libby's unit. Has anybody used/tested TPipeConsole? TPipeConsole uses standard pipes (OpenStdPipes calls CreatePipe), but then uses PeekNamedPipe on theses pipes in ProcessPipe. According to the documentation this is a blocking operation when used with anonymous pipes and the whole thing falls apart. Question: is this the case - does PeekNamedPipe blocks with anonymous pipes or this is only an issue when multiple threads try to access the same pipe? See also https://devblogs.microsoft.com/oldnewthing/20110707-00/?p=10223 by Raymond Chen
  4. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    Wrapping third party components is no different to wrapping VCL controls. Consider all the WrapDelphiXYZ units as demos on how to do that. - Please note that with EnhancedRTTI, the only thing that needs wrapping is events other than simple TNotifyEvent. So the wrapping code would be minimal. - There is no special wrapping needed for DataModules (TComponent descendent). Access to the Screen.DataModules property is already wrapped. - Data Access wrapping is provided by the WrapFireDAC unit - Demo 31 has extensive coverage of Forms (creation, subclassing etc.)
  5. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    After some investigation I have committed changes that eliminate the exceptions during library finalization. The comment above about hiding the form still stands. If the main form is closed with action caFree, all VCL does, is send a Quit message (i.e. does not hide or free the main form). If the application is not terminated (as is the case when running in PyScripter) the form is not closed. You need to hide it using f.Hide(). In PyScripter the python application is truly terminated when you reinitialize the interpreter or close down PyScripter.
  6. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    Python 2 support was dropped recently. But you can use the last release with Python 2 support. The VCL code is executed in the main thread. ExitThread and ExitProcess are called by python on shutdown. After Run is executed control is passed back to python. In a standalone run python would exit at that point. When run inside an IDE things may be different since the IDE will terminate the python process when appropriate.
  7. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    You only need to change the following two lines to match your python version: // Adapt to the desired python version - Will only work with this version gEngine.RegVersion := '3.8'; gEngine.DllName := 'python38.dll'; I am happy to evaluate PRs in relation to the termination issue. As I said it does work well when you run the python script standalone (not from a python IDE)
  8. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    The application terminates fine when run from the command line. You are right that when is run from PyScripter the form does not close. I am not fully sure, but it may have to do with the fact that PyScripter prevents the script from terminating so that the state of the interpreter can be examined after running a script. However you can hide the form by adding f.Hide() as the last statement of the main procedure.
  9. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    Did you try handling the Form OnClose event or use Release instead of Close?
  10. pyscripter

    DelphiVCL: Fantastic! But there are some issues

    Please file appropriate bug reports and open PRs, On note regarding WrapDelphi: The WrapDelphiXYZ units were written before the enhanced RTTI was implemented. Nowadays you do not need to wrap enumerations sets and the like. Here is an example from WrapDelphi unit tests: type TFruit = (Apple, Banana, Orange); TFruits = set of TFruit; TTestRttiAccess = class private FFruit: TFruit; FFruits: TFruits; public FruitField :TFruit; FruitsField: TFruits; StringField: string; DoubleField: double; ObjectField: TObject; RecordField: TTestRecord; InterfaceField: ITestInterface; procedure BuyFruits(AFruits: TFruits); property Fruit: TFruit read FFruit write FFruit; property Fruits: TFruits read FFruits write FFruits; end; With the above declarations and if you Wrap a variable say test of type TTestRttiAccess you can write python code such as: test.Fruit = 'Apple' test.Fruits = ['Apple', 'Banana'] So there is no need to create special wrappers of enumerations and sets. The WrapDelphi unit tests are worth studying in some depth.
  11. pyscripter

    Subforum for Python4Delphi

    @DanielCould you please create a subforum in the Third-Party section for Python4Delphi?
  12. pyscripter

    Subforum for Python4Delphi

    I would like to use the Delphi-Praxis Third-Party section as a support forum for Python4Delphi. Any idea how a subforum for Python4Delphi can be created?
  13. I guess everyone knows this already, but I did find this Stackoverflow answer surprising. Can you guess what is the message shown? function DoSomething(SomeBoolean: Boolean) : string; begin if SomeBoolean then Result := 'abc' end; procedure TForm1.Button1Click(Sender: TObject); var xx: string; begin xx := DoSomething(True); xx := DoSomething(False); ShowMessage(xx); end; Shouldn't the above deserve a compiler warning?
  14. pyscripter

    Olevariant and memory leak

    No the performance issue was https://quality.embarcadero.com/browse/RSP-23095 also fixed as suggested. https://quality.embarcadero.com/browse/RSP-23093 was a memory leak issue. Please read the reports. In both issues the suggested solution was implemented.
  15. pyscripter

    Olevariant and memory leak

    Glad to hear that! So it must be https://quality.embarcadero.com/browse/RSP-23093 that was causing the issue.