If you don't want to use Classes to maintain state, then you may want to have a global
variable or you can return the list from create_list()
.
Using global variable:
disc_list = []
def create_list():
global disc_list
disc_list = ['disc0', 'disc1', 'disc2']
def move_discs
cmds.move(disc_list[1], 0, 0, 5)
Note that using global variables is not encouraged.
Returning list from create_list()
:
def create_list():
return ['disc0', 'disc1', 'disc2']
def move_discs():
disc_list = create_list()
cmds.move(disc_list[1], 0, 0, 5)
But I don't think this will of much help to you as you probably need to keep the state of your list throughout the program.