-
Content Count
777 -
Joined
-
Last visited
-
Days Won
41
Everything posted by pyscripter
-
Thanks for responding. No, it is not that. I have tested with a new minimal app, just a form and a button to open the help file, and the issue still exists. I think it used to work with earlier versions of Windows/Delphi.
-
How to install Delphi 4 Python ? ImportError: DLL load failed while importing DelphiVCL: The specified module could not be found
pyscripter replied to William23668's topic in VCL
I dont't think python 11 is supported yet. -
In PyScripter we use dxgettext along with https://www.transifex.com/ for translations teams collaboration and github integration. dxgettext offers a great deal of control as to what should get translated and there is an advantage in using industry standard translation formats for which a variety of editing and management tools exist.
-
if i changed the P4D DLLPath how to reload DLLs ?
pyscripter replied to tomye's topic in Python4Delphi
Indeed. As I said it is not foolproof. If you use a specific set of python modules, you can see in Delphi's debug mode which DLLs are loaded when your python scripts execute. You can then write code to unload them after unloading python. Failing to unload a DLL does not necessarily mean that there will be an issue next time you load python. -
HELP ,can not run torch scipt but can be run in Python environment
pyscripter replied to tomye's topic in Python4Delphi
Running python in threads does not increase python code speed due to the GIL. Only one thread executes at any point in time. Torch can do its own mutli-threading so again there is no need to use threads. The main reason for using python threads is to avoid blocking the UI. -
if i changed the P4D DLLPath how to reload DLLs ?
pyscripter replied to tomye's topic in Python4Delphi
Unloading and reloading has always been possible with P4D, but quite tricky and not foolproof. You need to manually unload the dll's loaded by imported modules and if you fail to do that it will fail. PyScripter does that and allows you to change python version without exiting. -
HELP ,can not run torch scipt but can be run in Python environment
pyscripter replied to tomye's topic in Python4Delphi
Why are you making things complicated? Follow the KISS rule. Using threads in this way requires deep knowledge of the Python API and the complexities of GIL. If do have to use threads, please study Demo 11 and the related posts in this forum Showing results for 'Py_Begin_Allow_Threads'. - Delphi-PRAXiS [en] (delphipraxis.net) -
if i changed the P4D DLLPath how to reload DLLs ?
pyscripter replied to tomye's topic in Python4Delphi
It does, but it is not a good idea and should be avoided. See demo34 for how it can work. This demonstrates also AutoLoad = False -
if i changed the P4D DLLPath how to reload DLLs ?
pyscripter replied to tomye's topic in Python4Delphi
Set AutoLoad to False and call LoadDLL at Runtime (e.g. in your FormCreate). -
HELP ,can not run torch scipt but can be run in Python environment
pyscripter replied to tomye's topic in Python4Delphi
PythonHome needs to be set even for registered conda distributions See TPythonVersion.AssignTo(PythonEngine: TPersistent); in PythonVersions.pas about this is done. Note also that for conda distributions to work properly, you need to add Format('%s;%0:s\Library\bin;', [Version.InstallPath] to your Windows path if it is not there already. -
HELP ,can not run torch scipt but can be run in Python environment
pyscripter replied to tomye's topic in Python4Delphi
Is there another sqlite dll in your path? -
It is cross-platform. It supports all targets Delphi supports.
-
Same here. 11.1 was better I think with respect to LSP.
-
In general, Python scripts run just as fast (or better just as slow) using P4D in Delphi, as they do using python.exe. You need to show what you are doing in that respect.
-
MaskFPUExceptions · pyscripter/python4delphi Wiki (github.com)
-
Python4Lazarus is a fork focusing on fpc support. It does not include the based on WrapDelphi, delphifmx, delphivcl stuff.
-
This is now fixed. @acalandCould you please report whether fpc MacOS works ok?
-
Variants are converted to strings when shown in the debugger. It does not mean that they contain strings.
-
No it does not. You get a tuple containing arrays of floating type values. Are you using VarPyth? Is layerOutputs a Variant? If yes then you can use: var arr:Variant := layerOutputs.GetItem(0); // the first item of the tupple (array). var value:Variant := arr.GetItem(0); //the first floating value of the array
-
By the way and on record helpers, in my little program above, if you move the declaration var Rec: MyRec; to Unit 1, interestingly, the output is "Hi".
-
The issue was in the following: procedure TRegExHelper.AddRawOptions(PCREOptions: Integer); begin with Self do FRegEx.SetAdditionalPCREOptions (PCREOptions); end; FRegEx is defined in System.RegularExpressions and the nearest helper was in that unit. By the way the issue is now fixed. Thanks for reporting it.
-
Actually it is the other way round. From the docs: but "nearest scope" means closer to where the variable is declared. Just to prove: Project File: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils, Unit1 in 'Unit1.pas'; type MyRecHelper2 = record helper for MyRec procedure SayHi; end; { MyClassHelper1 } procedure MyRecHelper2.SayHi; begin WriteLn('Hello!'); end; var Rec: MyRec; begin Rec.SayHi; ReadLn; end. Unit 1 unit Unit1; interface type MyRec = record end; MyRecHelper1 = record helper for MyRec procedure SayHi; end; implementation { MyClassHelper1 } procedure MyRecHelper1.SayHi; begin WriteLn('Hi!'); end; end. Output: Hello!
-
What happens then in Delphi 11.2? Which record helper will be active? I thought you are not allowed to have two helpers for the same class in the same scope?
-
Yes indeed. Do you know how to IFDEF 11.2 vs 11.1?
-
Regular Expressions have been revamped. The following feature requests have been implemented: https://quality.embarcadero.com/browse/RSP-21733 https://quality.embarcadero.com/browse/RSP-22372 https://quality.embarcadero.com/browse/RSP-22381