[W2] Release 0.1 - getting out of Tutorial Land




This week we had to create a cli tool with our choice of language. I chose Python and started researching how to create a cli tool with it. Since I've never used Python (only watched several tutorial videos), it was frustrating at first. PyCharm couldn't recognize the import statements and configuring virtual environment for the project was totally confusing. 

I started by searching the regEx which will collect all URLs starting with either "http://" or "https://". Then I put those links in a List and removed duplicates by using a Dictionary (since Dictionary cannot have duplicate keys, it removed the duplicates. I could have done with Set as well!)



Then I made requests to the links and collected status_codes for the request. If the status code was 200, it would print the message "GOOD" with a color green. If the status code was 400, 404, or couldn't get the response within 1.5s, it would print the message "BAD" with the color red. Other exceptions would print the message "UNKNOWN" with the color white.



WALA?!



Comments

Popular posts from this blog

About Me

[W4] Lab 3