Python Forum
assigned variable fails to show up
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
assigned variable fails to show up
#1
i have a big script with a line that assigns an IPv6 address string literal to the variable ipv6and the next line tries to print it:
ipv6 = 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff/128'
print('ipv6 =',repr(ipv6))
running it in Python 3.5.2 gets:
Output:
Traceback (most recent call last): File "get_ipv6.py", line 96, in <module> print('ipv6 =',repr(ipv6)) NameError: name 'ipv6' is not defined
then i add print() calls to dump out locals() and globals() and 'ipv6' just was just not in there. how can i go about debugging this?

these lines were not indented at all and not in any if statements or loops. it should have been straight unconditional execution.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
assigned variable fails to show up - by Skaperen - May-27-2019, 10:07 AM
RE: assigned variable fails to show up - by buhtz - May-27-2019, 10:11 AM
RE: assigned variable fails to show up - by buhtz - May-27-2019, 10:31 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PIL Image im.show() no show! Pedroski55 2 1,010 Sep-12-2022, 10:19 PM
Last Post: Pedroski55
  PIL Image im.show() no show! Pedroski55 6 5,046 Feb-08-2022, 06:32 AM
Last Post: Pedroski55
  How to assigned value to each different binary in python... ZYSIA 2 2,081 Jul-12-2021, 11:01 AM
Last Post: Gribouillis
  Function assigned at a button in tkinter riccardoob 9 4,234 Oct-06-2019, 11:14 AM
Last Post: riccardoob

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020