Forum Discussion
Thanks for your suggestions.
I checked it, but it says about using the functions and variables from another script. But nothing about modification.
Arguments are passed by assignment in Python. Although cumbersome, you can workaround this via,
def test1(x):
x = x + 1
return x
def test2():
x = 1
Log.Message(x)
Log.Message(test1(x)) # Workaround
Python documentation will have more information on this.
- SangeetNenwani4 months agoContributor
Yes, as of now, I am using this for non-constants as arguments and using contact as local variable on top of script
- AlexKaras4 months agoChampion Level 3
Hi,
Some additional reading that I found inspired by reply from rraghvani and which was useful for me (who is absolutely not a Python guy):
-- https://www.geeksforgeeks.org/pass-by-reference-vs-value-in-python/
-- https://stackoverflow.com/questions/986006/how-do-i-pass-a-variable-by-reference
-- https://stackoverflow.com/questions/13530998/are-python-variables-pointers-or-else-what-are-they
-- https://stackoverflow.com/questions/2612802/how-do-i-clone-a-list-so-that-it-doesnt-change-unexpectedly-after-assignment
Related Content
- 9 years ago
- 4 years ago
Recent Discussions
- 6 hours ago