global-variables

Python global variable

I have two packages: Unloader.py And GetRequest.py In the script implemented in Unloader.py a function is called ... lResponse countNullResponse += 1 How can I correct the code so that Request sees the global variable countNullResponse?

is global in the function normal?

There is a class that works with the database there is a function that returns a specific string, including using the{[2] cla ... SELECT ... ', $param1, $param2); } Is this normal? or is it better to use something else to define $db inside the function?

Declaring a global variable inside a function

Is it possible to declare a global variable in a function? If so, how?