Question
Thread display: Collapse - |
All Answers
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Adding data to a list by line
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: 512x512
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','512x512']
I'm kind of new to programming, so the more description the better!
Thanks for any help in advance!