JMV1998
Posts: 2
Joined: Tue May 16, 2017 7:25 pm

SyntaxWarning is used prior to the global decleration

Tue May 16, 2017 7:41 pm

Hi I have been programming for a short period of time and do not know all the features of python in which I have come stuck with this warning. 'New_Item_Window' is used prior to global decleration.
I am unsure on how to tackle the problem any help would be greatly appreciated

scotty101
Posts: 2223
Joined: Fri Jun 08, 2012 6:03 pm

Re: SyntaxWarning is used prior to the global decleration

Tue May 16, 2017 8:44 pm

Posting your code would help.

but try something like

Code: Select all

New_Item_Window = None
right at the very start of your code.
Electronic and Computer Engineer
Pi Interests: Home Automation, IOT, Python and Tkinter

User avatar
elParaguayo
Posts: 1838
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK

Re: SyntaxWarning is used prior to the global decleration

Wed May 17, 2017 8:51 am

Agreed, we need your code but my guess is that you've got a variable called New_Item_Window in the main body of your script. You've then got function which tries to assign a value/manipulate to New_Item_Window. That will throw the error you're seeing unless your function includes the line "global New_Item_Window" before you try to manipulate the variable.
RPi Information Screen: plugin based system for displaying weather, travel information, football scores etc.

JMV1998
Posts: 2
Joined: Tue May 16, 2017 7:25 pm

Re: SyntaxWarning is used prior to the global decleration

Thu May 18, 2017 1:24 pm

[quote="scotty101"]Posting your code would help.

Thank you, for your help i will look at this and get back to you
Thanks again,
Josh

Return to “Python”

Who is online

Users browsing this forum: No registered users and 17 guests