Python Forum
Need help with an error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need help with an error
#2
You are referring to a global screen_numbers from within a function so it is looking for a variable in the function, which there isn't.

The best is to give the variable to the function as an argument and have it return the answer.

screen_numbers = Text(screen_topside, height='fill', width='fill')

def one(screen_numbers):
    screen_numbers = screen_numbers + '1'
    return screen_numbers


new_screen_numbers = one(screen_numbers)
Reply


Messages In This Thread
Need help with an error - by Miguel_Lona605 - Mar-25-2020, 09:17 PM
RE: Need help with an error - by michael1789 - Mar-25-2020, 09:35 PM
RE: Need help with an error - by Miguel_Lona605 - Mar-25-2020, 11:36 PM
RE: Need help with an error - by joe_momma - Mar-26-2020, 12:03 AM

Forum Jump:

User Panel Messages

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