# Python lang. question, reference to value/variable?

**URL:** <https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924>\
**Category:** Off-Topic\
**Tags:** python, habapp\
**Created:** [March 6, 2025, 8:50am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924 "2025-03-06T08:50:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![perIpI](https://community.openhab.org/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@perIpI](https://community.openhab.org/u/perIpI)\
**Post date:** [March 6, 2025, 8:50am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924/1 "2025-03-06T08:50:41Z")

</div>

Trying to access an object variable by reference but its not working the way I want (the list value will not follow the value of the ping\_stat.min/max/mean). Is it possible to achieve what I want?

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/0/0/00e01392a56f8dfe5ddbabbfc3db9f938cee39c7.png)

---

<div class="post-metadata">

**Author:** ![perIpI](https://community.openhab.org/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@perIpI](https://community.openhab.org/u/perIpI)\
**Post date:** [March 6, 2025, 9:14am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924/2 "2025-03-06T09:14:30Z")

</div>

Think I solved it. Needed to define local function calls returning the values I wanted.

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/9/a9f87a02a03e1a5509472a718fd3c81b32cacf95.png)

---

<div class="post-metadata">

**Author:** ![Spaceman\_Spiff](https://community.openhab.org/user_avatar/community.openhab.org/spaceman_spiff/32/56883_2.png) [@Spaceman\_Spiff](https://community.openhab.org/u/Spaceman_Spiff)\
**Post date:** [March 6, 2025, 9:21am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924/3 "2025-03-06T09:21:29Z")

</div>

On the first screenshot you append the current value.  
If you use the function you get the value at the time when you call the function

---

<div class="post-metadata">

**Author:** ![perIpI](https://community.openhab.org/letter_avatar_proxy/v4/letter/p/a87d85/32.png) [@perIpI](https://community.openhab.org/u/perIpI)\
**Post date:** [March 6, 2025, 9:33am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924/4 "2025-03-06T09:33:48Z")

</div>

Im used to be able to access by pointer/reference to object/value but I think this is not the way its done in python. As long as there is a compact way to do it, like a function call (“pointer”) its fine by me.

---

<div class="post-metadata">

**Author:** ![system](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/6/6a52f2ac5d00e4c7b50471a354b3a9221188be90.png) [@system](https://community.openhab.org/u/system)\
**Post date:** [April 17, 2025, 1:34am UTC](https://community.openhab.org/t/python-lang-question-reference-to-value-variable/162924/5 "2025-04-17T01:34:10Z")

</div>

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.
