DEV Community

Discussion on: Share a code snippet in any programming language and describe what's going on

Collapse
 
fen1499 profile image
Fen
def openReturn(path):
    temp = []
    f = open(path, "r")
    for x in f:
        temp.append(str.split(str.strip(x),","))
    return temp
Enter fullscreen mode Exit fullscreen mode

This python code takes a csv like file and breaks it into arrays, very handy option for simple usecases and also a great example of how to not name your variables