So I am using pypyodbc to connect to a SQL Server Database. For my code to work properly I believe the easiest and most efficient practice would be to open the connection and retrieve the data as a global variable. However, I vaguely remember reading somewhere that this is a bad practice and should be avoided. So my question is this, is this a bad practice and why? If so how bad? It could be avoided but it would be preferred to be a global variable. Thanks!
Asked
Active
Viewed 565 times
0
-
1Possibly helpful: http://stackoverflow.com/questions/22796917/what-does-global-variables-are-bad-mean – FamousJameous Aug 31 '16 at 19:51
-
Thank you @FamousJameous, I will need to keep this in mind to avoid mutating the data set and having a separate list of things I would be appending. – Steven Setteducati Jr. Aug 31 '16 at 20:01