Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I came across a scenario where the required parameters must be sent to python script in talend and the python script is being called by using tsystem component.
What my analysis is -> to store the parameters/user-input in a context and call the context variables in tsystem component.....
Can you pls let me know if this is approach is correct...
Thanks,
Ankit
This seems like an entirely reasonable approach. Just keep in mind that when using the tSystem component, you are essentially sending a Java String to the terminal. So when building your command with parameters, think about building a Java String that represents that command. For example....
If you are wanting to search a directory for txt files in one run and jpeg files in another, you could parameterise your extension name in a context variable called "fileExtension", then use it in a tSystem like below...
"cmd /c dir *." + context.fileExtension