bytesonly Blog

Weather 0


An app that shows actual weather data and a temperature forecast for the next five days.


Libraries used:


Day 4: Who needs loops?

Today I had a first glance at loops. Might be useful if I want to code, don’t you think? I thought so! So let’s see what I’ve learned:

  • Range is a built in function that generates numbers to loop over
  • XRange is a bit smarter: It’s a generator that only generates numbers when they are needed. Range itself generates all numbers beforehand and might therefore use more memory (especially when a loop is early exited
  • Indentation is something I need to get used to, but I think once I got the hang of it I will appreciate it, because it’s less to write
  • There are no block comments!! Whatttt?? Each line needs to be prepended with a #. I should

Day 3: Tweet an image and text

When I did my 3D everyday project, I uploaded every picture to Twitter. It only takes about a minute, but if you do this everyday, it sums up. It’s also a very repetitive task and therefore a bit annoying. I needed to copy the hashtags from the previous tweet, copy the name of the picture and then add the picture itself to the tweet. Today I wanted to see if I can automate this process with python. It was pretty simple. I followed this excellent tutorial It guides you through all the necessary steps to create the keys needed to post to Twitter. I then adjusted the script a bit, so it fits my needs. It now basically …


Day 2: Make a request and print http status code and header of the response

So today I wondered how easy it is to extract the http status from a response. Well guess what? It is very easy. All you need to do is install a library called urllib.

Extracting the http status code and the header information are just two lines of code. Pretty cool.


Day 1: Open browser, navigate to a page and login in

Today I wanted to see if I can automate my browser easily. Since I already have experience with Selenium, not everything was new to me.


Getting started with Python

Since about a year I felt like I should learn Python. I haven’t analysed different programming languages nor did I think about the pros and cons. I also didn’t pick Python because I think it would be beneficial for my career path. It’s purely out of curiosity and somehow it feels right. I don’t know much about the language at this point. All I know is that it’s good for number crunching and that it’s useful for a whole variety of tasks. I think I’m interested in it, because it makes the automation of network tasks easy. Anyway, I kept on postponing it, until today when I realised that I just need to start at some point. I decided to …