How to store a list or an array with python so its global available? I think I know this is a basic question but I dont got the connection between values inside a class and outside.

I have an Array with string values defined in a OperatorClass and I can use it inside but what I really want is defining the Array Values outside of the class and then reference it when needed - everytime I define a PropertyGroup or StringProperty I cant find it...

I think I miss some basic understanding where values are stored in that blender data structure or how to add the array to some kind of globalness…

EDIT:
so I would like to outsource the Arrays from this class

class OBJECT_OT_createWorkFolder(bpy.types.Operator):
    bl_idname = "object.workfoldbtn"
    bl_label = "Create Projectfolder"
    bl_description = "Fügt dem Ausgew. Verzn. Arbeitsfolder hinzu"

    Workfolder = ["00_DATA","01_INCOMING","02_Workspace","03_Render","04_Compositing","05_OUT"]
    WS_Subfolder = ["02_0_Exports","02_1_Assets", "02_2_Textures","02_3_Light","02_4_Scripts","02_x_Caches"]
    Rndr_Subfolder = ["03_0_TestRender","03_1_FINAL"]
    Comp_Subfolder = ["Photoshop","AfterEffects","DaVinciRes"]
...
Two methods:


Method 1: python way


import bpy

arr = ["string1", "string2"]

class ClassName(bpy.types.Operator):

    def execute(self, context):
        for str in arr:
        print(str)

    return {'FINISHED'}

classes = (
    ClassName,
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)

if __name__ == "__main__":
    register()




Method 2: Blender way


import bpy

class Variables(bpy.types.PropertyGroup):
    string1: bpy.props.StringProperty(name="a string")
    string2: bpy.props.StringProperty(name="another string", default="default value")

class ClassName(bpy.types.Operator):

    def execute(self, context):
        bpy.context.scene.var.string1 = "Hello World"
        print(bpy.context.scene.var.string1)
        print(bpy.context.scene.var.string2)

    return {'FINISHED'}


classes = (
    ClassName,
    Variables,
)

def register():
    from bpy.utils import register_class
    for cls in classes:
        register_class(cls)
    bpy.types.Scene.var = bpy.props.PointerProperty(type=Variables)

def unregister():
    from bpy.utils import unregister_class
    for cls in reversed(classes):
        unregister_class(cls)      
    del bpy.types.Scene.var

if __name__ == "__main__":
    register()




learnt from: Godot Game Tools

edit: 
this is how you can access a variable in blender from anywhere. I've used GodotGameTools as an example and also highlighted what it should have been if you used my code