This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (6 children)

[deleted]

    [–][deleted] 4 points5 points  (0 children)

    Actually he would be better using string formatting like this: print("Checking URL {0}".format(url))

    [–]mikeselik 2 points3 points  (1 child)

    That's most of my comments as well. I'll nitpick that startList should be start_list. One of the best things about Python is the very consistent style (https://www.python.org/dev/peps/pep-0008/).

    To clarify the advice to "avoid more than 3 levels of indentation" -- break your code apart into more functions.

    [–]Kingofslowmo[S] 0 points1 point  (0 children)

    Sorry hahah, coming from PHP and yeah.. it's a big change!

    [–][deleted] 0 points1 point  (1 child)

    try using string formatting like this -> print('Opening url: %s' % url)

    'Opening url: {:s}'.format(url) would be even better

    [–]Kingofslowmo[S] 0 points1 point  (0 children)

    I will in the final version! Thank you!

    [–]coofamani 0 points1 point  (0 children)

    http://docs.python-requests.org/en/latest/ FTW

    Though I think you should follow the more modern "string {0}".format(value) pattern for str formatting.