[Python] Can I somehow import/use lists from files made by code in python?

Discussão em 'Python' iniciado por Stack, Maio 16, 2025.

  1. Stack

    Stack Membro Participativo

    Every time a new member joins the discord server a new file (with their id as name) is created (e.g. @1242123910123.py) Later in code I want to check things from these lists but first I have to get access to these files.

    How these lists look:

    Data = [
    [ # achievements - 0
    ['Boter', 'Write 10 Ach Commands', 0, 10, None],
    ['Greetings', 'Welcome Ach APL 2 Times', 0, 2, None],
    ['Party!', 'Invite 5 Friends', 0, 5, None],
    ['Developer Wannabe', 'Use the Code Style for Your Message', 0, 1, None],
    ['THATS BIG', 'Make Your Message BIG', 0, 1, None],
    ['Pizza', 'Make Your Message Italian', 0, 1, None],
    ['T H I C K', 'Make Your Message thick', 0, 1, None],
    ['Ciii.. no spoilers', 'Turn Your Message Into an Unforgivable Spoiler', 0, 1, None],
    ['Borderline? More like underline', 'Add Ground for Your Message', 0, 1, None],
    ],
    [ # stats - 1 index
    0, #messages - 0
    0, #time_on_server - 1
    0, #achievements - 2
    0 #invites - 3
    ]
    ]


    e.g. I want to change Data[0][2] from 0 to 1

    this is how my folder looks like the files to read are in membersData and code is run inside main

    I have tried different things on my own with import but I only got errors, but I need to have it working, without it I have to change almost the entire already written code

    I`ll be really thankful for any help

    Continue reading...

Compartilhe esta Página