Python newbie - a better way to write some code.
I have a question regarding "the python way" to do stuff.
The goal is simple.
1) Open a file
2) Parse it's content
3) split it to a list and move forward.
The file is URL list, really straightforward:
The code is like this:
ulist = open('url.txt', 'r')
lines = ulist.read()
lines = lines.split('\n')
# for some reason there is a newline as a last item of the list, so i have to
lines = lines.remove('')
How can i do it better?
Well usually you want to do something with each line, like so:
How about a terse version :
|All times are GMT -5. The time now is 04:08 PM.|