Storing And Calling a script: a cleaner way? lazarus / 9-Editor ---------------------------------------------------------------------- pseudomino · 2009-11-26 21:21 Hello everybody Well, I just managed to use a python script with my Lazarus little prog, through a TProcess, but I find what I did quite barbaric... To sum up: I saved my script.py into a script.txtI converted script.txt into script.lrs using lazresI implemented script.lrs into my program and loaded in a StringList var the text content of the scriptThen the program saves this text script in a temporary script.py ...sets the TProcess.CommandLine to "script.py "+ the arguments I need... executes the TProcess ...and finally removes the temporary file "script.py" What I simply want is to increase portability, having just the compiled executable in the end, and not the executable, plus the script.py, which necessarily has to be well located etc... (Well presently it works doing so but it will not work if the program is run in a folder not owned by the user - I'm using Linux - it's very dirty) There should be a cleaner way to call a script AND to incorporate it in the project, no? ---------------------------------------------------------------------- Leledumbo · 2009-11-28 07:23 QuoteThere should be a cleaner way to call a script AND to incorporate it in the project, no?Since AFAIK when python is run without file argument, it waits for input from stdin, you can use LazarusResources.Find() to get your script as string and use TProcess.Input.Write() to give input to python.