shanenin Posted June 20, 2005 Report Share Posted June 20, 2005 (edited) I have this function belowdef movie_find(): import os import string ls_dir = os.listdir('/home/shane/freevo/movies') dir_list =[] for i in ls_dir: if string.find(i,'.mp4') != -1: if i[0] != '.': if string.find(i,'.conf') == -1: dir_list.append(i) if string.find(i,'.avi') != -1: if string.find(i,'.conf') == -1: dir_list.append(i)how do I use the return so I am able to use the list called dir_list out side of the function.I have tried adding return dir_listto the function, but that does not seem to help Edited June 20, 2005 by shanenin Quote Link to post Share on other sites
shanenin Posted June 20, 2005 Author Report Share Posted June 20, 2005 I feel stupid. I was trying to use the info that I returned in the function with the varaible name used in the functionwrong wayprint dir_listcorrect wayprint movie_find() Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.