Juan C.Cilleruelo 12 Posted December 30, 2022 I have the following functionality, currently made with PacalScript, and I want to implement it in Python. I create a script component on the fly and programmatically create some variables of different types inside it. After I load the script proportionated by the user and I execute it. If all goes well, I recover the current values of the firstly proportionated variables and apply them to my Delphi program. Also, the end user can use some methods implemented in the Delphi main program inside the script. Summarizing: 1- I need to create variables on the fly inside a Python Script. 2- I need to recover the current values of some variables inside a Python Script. 3- I need to create some functions inside a Python script that can be called from it but really exists in the host Delphi program. Can anyone help me or knows where I can find examples of these three functionalities? Share this post Link to post
pyscripter 689 Posted December 31, 2022 python4delphi/Demos at master · pyscripter/python4delphi (github.com) python4delphi/Tutorials at master · pyscripter/python4delphi (github.com) 1 Share this post Link to post
Juan C.Cilleruelo 12 Posted December 31, 2022 36 minutes ago, pyscripter said: python4delphi/Demos at master · pyscripter/python4delphi (github.com) python4delphi/Tutorials at master · pyscripter/python4delphi (github.com) Thank you for your response, but it is as general as absolutely useless. Do you know which of these pleiad of demos are the ones that solve each of my requirements? These are the types of responses really useful. But thanks a lot for your time. Share this post Link to post
programmerdelphi2k 237 Posted December 31, 2022 Python Script dont allow this? https://stackoverflow.com/questions/1373164/how-do-i-create-variable-variables https://stackoverflow.com/questions/13887798/saving-and-recovering-values-of-variables-between-executions Share this post Link to post
Juan C.Cilleruelo 12 Posted December 31, 2022 27 minutes ago, programmerdelphi2k said: Python Script doesn't allow this? https://stackoverflow.com/questions/1373164/how-do-i-create-variable-variables This is not related to my questions. "Variable variable names?????" it seems like a tongue twister! 27 minutes ago, programmerdelphi2k said: https://stackoverflow.com/questions/13887798/saving-and-recovering-values-of-variables-between-executions I don't need to recover anything. I need to start a Script with a group of variables created on his memory, and just before freeing this Script Object, recover the Variables. I'm sorry if my explanations take you a misunderstanding situation. Share this post Link to post
Juan C.Cilleruelo 12 Posted December 31, 2022 20 hours ago, Juan C.Cilleruelo said: I have the following functionality, currently made with PacalScript, and I want to implement it in Python. I create a script component on the fly and programmatically create some variables of different types inside it. After I load the script proportionated by the user and I execute it. If all goes well, I recover the current values of the firstly proportionated variables and apply them to my Delphi program. Also, the end user can use some methods implemented in the Delphi main program inside the script. Summarizing: 1- I need to create variables on the fly inside a Python Script. 2- I need to create some functions inside a Python script that can be called from it but exists in the host Delphi program. 3- I need to execute the python script that the final user wrote and modify the created variable values. The final user can use all the Python Scripting language and the functions my program gives him. 4- Finally, I need to recover the current values of the variables created in the first step inside the Python Script and put these values into the original Delphi variables to continue processing. Can anyone help me or knows where I can find examples of these three functionalities? I modified the initial explanation to a better understanding of my leisurely objective. I want to remark that this is currently working with very old and primitive Pascal Scripting Components. I know that all of this is possible with python, and I know that by taking considerable time to understand and practice all the capabilities of Python Scripting components, I will be able to do all these things. I'm appealing to the knowledge of previous users of these components to simplify my path to the solution. Thanks to all of you. Share this post Link to post
Juan C.Cilleruelo 12 Posted December 31, 2022 AUTO-RESPONSE: Demo4 of the Demos installed with the components shows how to create TPythonDelphiVar components that are some representants for Variables that can be used inside Python Scripts and Delphi indifferently. I will continue looking for the methods delegate component of Delphi's methods inside the Python Script. Share this post Link to post
pyscripter 689 Posted December 31, 2022 (edited) 15 minutes ago, Juan C.Cilleruelo said: I will continue looking for the methods delegate component of Delphi's methods inside the Python Script. Watching the video tutorials I have pointed out and looking at the respective demos, would save you a lot of time. Edited December 31, 2022 by pyscripter Share this post Link to post
Juan C.Cilleruelo 12 Posted January 1, 2023 14 hours ago, pyscripter said: Watching the video tutorials I have pointed out and looking at the respective demos, would save you a lot of time. Watching all the video tutorials. I want to be efficient in time. My ask was very concise, True? Share this post Link to post
Juan C.Cilleruelo 12 Posted January 1, 2023 14 hours ago, pyscripter said: Watching the video tutorials I have pointed out and looking at the respective demos, would save you a lot of time. If you don't know a concrete item to my question, your answer is just noise for my learning. Share this post Link to post
Juan C.Cilleruelo 12 Posted January 1, 2023 AUTO RESPONSE: In Demo7 I've seen the TPythonModule component. I think that I have all I need. I'm going to start the substitution of Pascal Script by Python. Thank you all! Share this post Link to post