-
Content Count
1019 -
Joined
-
Last visited
-
Days Won
66
Posts posted by pyscripter
-
-
iOS is supported.
For Android look at the Embarcadero fork.
-
5 hours ago, programmerdelphi2k said:here Ctrl+F works
Which Delphi version?
Which Windows version?
Could you please try using the Delphi way?
- Add Vcl.HTMLHelpViewer to the dpr uses clause
- Set Application.HelpFile = to your chm file
- Use the Application Help commands to invoke help (e.g. Application.HelpShowTableOfContents. Application.HelpContext etc.)
-
20 minutes ago, programmerdelphi2k said:it would be because "Ctrl+F" is a "Search on Editor-code"?
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.
-
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.
-
I dont't think python 11 is supported yet.
-
1
-
-
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.
-
19 hours ago, Brian Evans said:PyScripter is opensource so you can read the code. A quick look seems to suggest it doesn't - it unloads a bunch of common .pyd that might be loaded.
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.
-
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.
-
8 hours ago, David Heffernan said:Has this changed?
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.
-
1
-
-
17 hours ago, tomye said:as i said, i set
TPythonThread.Py_Begin_Allow_Threads;
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)
-
18 hours ago, tomye said:Yes, i did , but does not work , so i post the question on here
does the P4D not support LOADDLL and UNLOADDLL dynamic call ?
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
-
Set AutoLoad to False and call LoadDLL at Runtime (e.g. in your FormCreate).
-
16 hours ago, tomye said:the anaconda which i installed is 64-bit
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. -
Is there another sqlite dll in your path?
-
7 hours ago, Rollo62 said:but I'm afraid I cannot use P4D since this has to be CrossPlatform.
It is cross-platform. It supports all targets Delphi supports.
-
1
-
-
46 minutes ago, Stefan Glienke said:11.2 is a nightmare - prior to LSP the worst was that ctrl+click did not work. Now, most of the time nothing at all works because LSP dies all the time.
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.
7 hours ago, RDAF said:or the mechanism that transfers variables between Python
and Delphi
You need to show what you are doing in that respect.
-
-
On 9/28/2022 at 10:28 PM, acaland said:what is the difference between P4D and Python4Lazarus?
Python4Lazarus is a fork focusing on fpc support. It does not include the based on WrapDelphi, delphifmx, delphivcl stuff.
-
-
2 hours ago, BennieC said:Variants are converted to strings when shown in the debugger. It does not mean that they contain strings.
-
2 hours ago, BennieC said:Value: (array([[0.09, 0.03, 0.34...0.]]. dtype=float32), array([[0.06, 0.05, 0.67...0.]]. dtype=float32))
Currently this is just returned as a value with name layerOutputs, but Delphi sees this as a character string
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".
-
6 minutes ago, Vincent Parrett said:If that were the case, then you wouln't need to change anything at all in SynEdit - but you do as it cannot see SetAdditionalPCREOptions.
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.
-
2
-
don't works import pandas or openpyxl in TPythonThread (delphi)
in General Help
Posted · Edited by pyscripter
Please post questions regarding P4D to the Third Party P4D support forum.
What is this InitThread?
Using python threads 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 the P4D forum Showing results for 'Py_Begin_Allow_Threads'. - Delphi-PRAXiS [en] (delphipraxis.net)