On Tuesday, September 13, 2016 at 6:42:56 AM UTC-4, Daiyue Weng wrote:
> Hi, I defined a global variable in some function like this,
>
> def some_function(self):
>
> global global_var
>
> PyCharm inspection gave me,
>
> Global variable is undefined at the module level
>
> How to fix this?
It probably wants you to have a line at the top-level of the module (outside of
any function) defining the variable:
global_var = None # or some other default value
--Ned.
--
https://mail.python.org/mailman/listinfo/python-list