Closed g-mc closed 6 years ago
Use tuple of prefixes in str.startswith (instead of two separate calls)
str.startswith
Return True if string starts with the prefix, otherwise return False. prefix can also be a tuple of prefixes to look for. >> input_source = 'http://www.google.com' >> input_source.startswith('http://') or input_source.startswith('https://') True >> input_source.startswith(('http://', 'https://')) True >> input_source = 'https://www.google.com' >> input_source.startswith('http://') or input_source.startswith('https://') True >> input_source.startswith(('http://', 'https://')) True
Return True if string starts with the prefix, otherwise return False. prefix can also be a tuple of prefixes to look for.
>> input_source = 'http://www.google.com' >> input_source.startswith('http://') or input_source.startswith('https://') True >> input_source.startswith(('http://', 'https://')) True >> input_source = 'https://www.google.com' >> input_source.startswith('http://') or input_source.startswith('https://') True >> input_source.startswith(('http://', 'https://')) True
Use requests to encode & pass in parameters (instead of manually building the url)
requests
Looks good, thanks!
Do you know if you've signed a Google CLA? https://github.com/google/gif-for-cli/blob/master/CONTRIBUTING.md
Yes, I signed it before I sent this PR in.
Thank you!
Use tuple of prefixes in
str.startswith
(instead of two separate calls)Use
requests
to encode & pass in parameters (instead of manually building the url)