Walt Mankowski on 3 Sep 2018 14:55:06 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Off Topic: Python3 Global Variable in Separate Function File Question


On Mon, Sep 03, 2018 at 11:05:30AM -0400, Casey Bralla wrote:
> I want to put all my "utility" functions in a separate file which is
> available to multiple python programs.  How can I make some of these
> variables global?  BTW, I realize I could make the function simply
> return the variable, but my program is dealing with a  block of 55
> database variables, and global variables seems the best approach for
> this application.

TBH I'm confused about why having 55 of these variables makes you
*more* prone to want to use global variables. I'd think with that
many I'd be way more likely to encapsulate them inside an object.

Walt

Attachment: signature.asc
Description: PGP signature

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug