-
Content Count
920 -
Joined
-
Last visited
-
Days Won
56
Everything posted by pyscripter
-
Did you install the master branch from pyscripter/python4delphi: Free components that wrap up Python into Delphi and Lazarus (FPC) (github.com)? Here Demo01 and other demos run fine.
-
You may want to give pyscripter/Ssh-Pascal: Delphi ssh library wrapping libssh2 (github.com) a try. It is a wrapper around libssh2, includes scp, sftp, ssh support. Very fast.
-
Use TThread.ForceQueue from inside the OnShow handler. TThread.ForceQueue accepts an optional delay.
-
Question: Is there a way to tell whether a method is overloaded using rtti?
pyscripter posted a topic in RTL and Delphi Object Pascal
As per title. For instance: A) Second method hides the first ClassA = class procedure Test(I: Integer); end; ClassB = class(classA) procedure Test(S: string); end; B) Second method overloads the first ClassA = class procedure Test(I: Integer); overload; end; ClassB = class(classA) procedure Test(S: string); overload; end; How can you tell the difference with Rtti. GetMethods would show both methods in a similar way. -
Rtti Question: Is there a way to tell apart class fields from other fields?
pyscripter posted a topic in RTL and Delphi Object Pascal
TTest = class A: string; class var B: string; end; Is it possible to tell that B is a class field using Rtti? Ditto for properties. And if you get a chance have a look at my other Rtti question. -
Rtti Question: Is there a way to tell apart class fields from other fields?
pyscripter replied to pyscripter's topic in RTL and Delphi Object Pascal
Never mind. I forgot the answer to an older question. No rtti is generated for class fields and properties, which is a shame. It does for class methods though. -
Question: Is there a way to tell whether a method is overloaded using rtti?
pyscripter replied to pyscripter's topic in RTL and Delphi Object Pascal
But so do overwritten methods, virtual methods etc. -
This was a python reference counting issue. Fixed in version control. Please try the latest version and confirm the issue is solved.
-
Are you following the instructions at Installation · pyscripter/python4delphi Wiki (github.com)? Specifically, did you build all packages before installing them?
-
Clear the output?
-
Playing with Windows Fibers by emulating Python Generators
pyscripter replied to darnocian's topic in I made this
This project deserves some attention (greenlets-coroutines, generators, channels and more). It is based on fibers. -
Unable to run 2 TPythonEngine per VCL application
pyscripter replied to Dmitry72's topic in Python4Delphi
You cannot load multiple versions of any dll simultaneously in a single process. If you study Demo 33, you will see that this is not necessarily the case. -
Unable to run 2 TPythonEngine per VCL application
pyscripter replied to Dmitry72's topic in Python4Delphi
Why do you conclude that? If you want to run python code in threads, please study Demo 33 and search for related content in this forum (there is lots). Also google for "Global Interpreter Lock". -
In my Delphi apps, I use the dated CHM Html Help format to provide user help. When help is invoked from the Delphi app using the Application help commands, Ctrl+F to search within a help page does not work. However, if open the same chm file outside the Delphi app, Ctrl+F works fine. Any clues as to what causes this issue? Note: The Delphi app is compiled with Alexandria (v11) and I am testing on Windows 11.
-
Module "sentence_transformers" import in P4D not possible
pyscripter replied to JGMS's topic in Python4Delphi
Running python in threads is not straightforward. Have a look at TPythonThread, Demo 33, and search this forum for relevant discussions. -
Module "sentence_transformers" import in P4D not possible
pyscripter replied to JGMS's topic in Python4Delphi
Then try the following before loading the engine: - Create a TPythonInputOutput - Set the PythonEngine IO property to the TPythonInputOutput - Set the RedirectIO property to True. -
Module "sentence_transformers" import in P4D not possible
pyscripter replied to JGMS's topic in Python4Delphi
Looks like the python module is trying to write to the console. Do you use TPythonGUIInputOutput linked to the PythonEngine? If not try setting UseWindowsConsole to True. -
Module "sentence_transformers" import in P4D not possible
pyscripter replied to JGMS's topic in Python4Delphi
Did you mask exceptions (MaskFPUExceptions · pyscripter/python4delphi Wiki (github.com)? If yes, have you checked sys.version and sys.path to make sure they are the same as in stand alone python? -
You can either install python and PyPDF2 in the target machine or distribute an embedded version of Python with your app. If you follow the second route, have a look at Embarcadero/PythonEnviroments: Components to simplify the deployment for Python environments for Delphi applications using Python4Delphi. (github.com).
-
PythonEngine and VCL.PythonGUIINPUTCOMPONENT not working
pyscripter replied to Eezygzy's topic in Python4Delphi
Did you use the GetIt version? If not have you read Installation · pyscripter/python4delphi Wiki (github.com)? -
I have recently submitted two Vcl related quality issue reports: https://quality.embarcadero.com/browse/RSP-41987 https://quality.embarcadero.com/browse/RSP-41988 The first one relates to a change in TCustomForm.SetParent introduced in Delphi Alexandria. It broke docking behaviour, but there may be other applications affected. One way to work around it is to set the form AutoScroll property to True. Question: Are there any undesired consequences of doing this? The second report relates to the fact that TControlForm.ChangeScale is not used and there is no good available options to achieve what you do when you overwrite ChangeScale in custom controls. Question: Am I missing something? Is there a good way to execute some code whenever the form dpi is changed?
-
Have you read these: MaskFPUExceptions · pyscripter/python4delphi Wiki (github.com) FindingPython · pyscripter/python4delphi Wiki (github.com) with reference to Anaconda?
-
This is an old thread, but I have just noticed that Delphi 11 deals with this issue by calling the new LockDrawing/UnlockDrawing wrapper around WM_SETREDRAW in DoBeforeMonitorDpiChanged/DoAfterMonitorDpiChanged. They have also fixed https://quality.embarcadero.com/browse/RSP-30931. It seems to work reasonably well now.
-
Found why LSP stopped working in Delphi 11.2 and 11.3
pyscripter posted a topic in Delphi IDE and APIs
See [RSP-41949] LSP does not work when project includes modified file found in the search path - Embarcadero Technologies for details. Has anyone been bitten by this? Code Insight now works in my PyScripter project. I thought that cyclic unit dependencies may be the cause and spent quite a bit of time reducing them. I guess, that this was time well spent, but it was not the source of the LSP failures. -
Found why LSP stopped working in Delphi 11.2 and 11.3
pyscripter replied to pyscripter's topic in Delphi IDE and APIs
It turns out that the causes of LSP failure were more complex than I originally thought. In the attached project in TestCI-JclSysUtils LSP does not work. The project is relatively simple. It has three units Unit1.pas (a form with one button) uCommonFunctions.pas (contains three functions) JclSysUtils (an exact copy of the Jcl unit) With Jcl installed it compiles and runs fine. Here is the interesting thing. LSP starts working if: either you remove an unused import of JclPeImage from the uses clauses of uCommonFunctions or you remove the "forked" JclSysUtils from the project. Looks like LSP is a lot more fragile than is should be. I was without IDE support in my a project, since Delphi 11.2 was released and it took substantial effort and a bit of luck to restore it. TestCI-JclSysUtils.zip