Jump to content
Juan C.Cilleruelo

Programmatically, from Delphi, I need to include some variables in the python script.

Recommended Posts

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
36 minutes ago, pyscripter said:

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
27 minutes ago, programmerdelphi2k said:

  This is not related to my questions. "Variable variable names?????"  it seems like a tongue twister!

 

27 minutes ago, programmerdelphi2k said:

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
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

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
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 by pyscripter

Share this post


Link to post
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
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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×