0

I have a query similar to this:

c.execute('''select FileSize, FileName, FileType from ExampleTable
    where FileType = ?''', [FileType])
bestCRThLocal = list(c.fetchall())
print(bestCRThLocal[0]);

I want to have arrays for FileName, FileType and FileSize each own their own.

What is best way to do this in python?

1 Answer 1

1

Use zip(). Example:

>>> l = [[1, 2, 3], [4, 5, 6],[7, 8, 9]]
>>> zip(*l)
[(1, 4, 7), (2, 5, 8), (3, 6, 9)]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.