Adding data to a list by line - TechRepublic
Question
October 11, 2010 at 09:42 AM
longestne

Adding data to a list by line

by longestne . Updated 15 years, 8 months ago

Hey guys,

Say I was using the subprocess module to print data listed in the command line of UNIX into python. For example:

File: FileName.jpg
FileSize: 1024
FileRes: 512×512

How would I add that data to a list by line? Or perhaps even better, how would I add that data to a list for everything after the colons. For example, I want that data to become:

[‘FileName.jpg’,’1024′,’512×512′]

I’m kind of new to programming, so the more description the better!

Thanks for any help in advance!

This discussion is locked

All Comments