-
Content Count
181 -
Joined
-
Last visited
Everything posted by softtouch
-
Freeing TPythonModule after using it takes long
softtouch replied to softtouch's topic in Python4Delphi
I stopped the time and it takes around 5 second until the .free returns. If I dont free it and just free the pythonengine, that will take 5 seconds (I guess for releasing the module). It definitely only take so long when the delphi function was called once from python, even the delphi function does not do anything. If I dont call the delphi function from python, there is no delay at all. -
A TEdgeBrowser is on a form and has a webpage loaded, and the devtools windows is open also. Is there any way to get a notification when the user right-click in the devtools window an element and select "copy->XPATH"? I need to close in that case the browser form and get the text from the clipboard to process is further.
-
I have a python script which does some website work, and at one point in that script, it has to call a Delphi function with a byte array as parameter, and will have to get a string back from the Delphi function and continue the script execution. How can I realize that? I googled but its mostly the other way around, calling a python function from delphi.
-
How to call a Delphi function from a python script?
softtouch replied to softtouch's topic in Python4Delphi
I know, I use P4D... I can call python funtions from delphi, but this time, I need it the other way around, calling a delphi function from python. -
How to call a python function with parameter and get the result
softtouch posted a topic in Python4Delphi
I am playing for the first time a little with Python4Delphi. When I have a python function, for example: def Parser(src:str) -> str: s = "Test " + src return s How do I call this from Delphi? I have this script in a stringlist, and can call PythonEngine1.ExecStrings(sl); But how do I set the parameter "src" before calling the script, and how do I get the "s" value back after the call? -
How to call a python function with parameter and get the result
softtouch replied to softtouch's topic in Python4Delphi
Ok, that seems to work as expected. Thanks. -
Does anybody know of any easy to learn opensource scripting language? I need to be able to send string to the scripting engine from Delphi, have it process the strings and return the result to Delphi. I also need to be able to load such scripts at runtime and execute them. Each of such script need to do different thing, based on some parameter, so I might need to load many different scripts at the same time.
-
Back to searching... LUA is not what I can use, it seems not to support UTF-8 for files.
-
But it was a good find 🙂 It works well so far. Thanks again.
-
Thanks for all the suggestions. I think I will go with lua as recommended by Lars Fosdal (thanks for that). I got most things running already and even it has no regex, gmatch and some other will do it.
-
Maybe I could use gmatch instead of regex, that might be ok. I am currently playing with lua, but could not yet figure out how to return a string to delphi.
-
Not sue lua is ok for my project. I saw it does not know anything about regex.
-
Python is too huge for just the small things I want to do, and I dont want to dig into python programming. I took a look at TJvInterpreterProgram, but its hard due to lack of documentation. It works, but I could not figure out how to use system functions like copy, delete etc. from within the code for the interpreter.
-
DWScript seems to be up to Delphi 11.x only, but I use Delphi 12.
-
When I try to open getit in the tools menu, the IDE freeze and I need to use taskmanager to kill the process. When trying to go to my.embarcadero.com, I get a 504 error.
-
I am trying to find, without success, information about how to catch when somebody click in a TEdgeBrowser into a form field, or on a table, or any other element. I can catch hyperlick clicks, but thats all so far. Is that even possible? What I need to do is, when a user click somewhere, to show the source code of that element.
-
Wow, cool, thanks a lot! I will play with it. So the window.addEventListener is the key to do what I want.
-
It might be in a memo, so I need just the text to process it further.
-
What I want is that the user load a website, and can click on any element/text/whatever on that page, and that the outerhtml will be displayed, no more, no less. Using the "inspect" is way to confusing for the user.
-
I am looking for a edit/memo component which allows multiselect. For example, I have a text "This is just a test" in the edit/memo and would like to select "This" and "test". I tried to find such component, but without luck. Does it exist or is it just wishful thinking?
-
I believe I solved it using the TPlusMemo.
-
Just to show what I mean:
-
Thats a pity. I thought there is such control. Notepad++ can do that.
-
Thanks, I tried that already, but was not able to have it measure the execution time of my procedures.