Skip to main content

Posts about dgplug (old posts, page 19)

A Hundred Days of Code, Day 011

Ok the weather app is done.
Er, only it’s not the weather app anymore, it’s just a temperature app.
The program was meant to pull all sorts of details from Wunderground and apparently the site has changed into a different, more complicated (to me) web page.
I did not want to spend all my time, futzing with CSS.
So I figured out how to just pull out the place name and the temperature and display it.

Things I learnt,

  • How to use Requests and Beautiful Soup to scrape and parse web pages.
  • Practiced my documentation skills a bit.
  • Learnt to fend for myself.

The code’s on Gitlab and Github.


A Hundred Days of Code, Day 010

Working on the get tempature / mini weather app.

  • Learnt about type hints.(I intuitively needed this feature as I kept dotting in my editor waiting for stuff to pop up :P glad to know such a thing exists and Python supports it.)
  • Learnt about named tuples. I love anything that will let me name things the way I want.
  • Learnt about sanitising text that we extract from a web page; stripping white space and new lines and crazy characters and what not.
  • Grateful for the batteries included nature of Python. Well, not necessarily batteries included as much as batteries available on demand. Batteries of all shapes and sizes at that. I can only imagine what writing such a program from scratch must involve. To all the generous people, making modules and libraries available to use freely, and to the infrastructure that delivers it, you folk have my undying gratitude.

A Hundred Days of Code, Day 009

Cooking along on the weather project.
Managed to pull down a web page, put it into a object, return in and then create some ‘soup’ out of it.
It handily lets me inspect a lot of stuff, but finding what I want seems to be confusing.
Brains are mush right now.
Will give it another go, tomorrow.


A Hundred Days of Code, Day 007

Started up with a weather app today.
It is supposed to scrape the weather from Weather Underground, parse it a bit and then give you the weather.
Made the template of the app.
For some reason requests does not seem to be recognised in VSCode.
Will do more tomorrow.


Gaiman on Writing

The truth is, I think, […] for me inspiration comes from a bunch of places.

(Counting on his fingers …) Desperation, deadlines …

A lot of times, ideas will turn up while you are doing something else.

And most of all, I think, ideas come from confluence.

They come from two things flowing together, they come, essentially from day-dreaming. It’s … it’s something I suspect that’s something that every human being does.

Writers tend to train themselves to notice when they’ve had ideas. Not that they get anymore ideas or get inspired more than anyone else. We just notice. We notice when it happens, a little bit more.

You go,well, you know, everybody knows that if you get bitten by a werewolf, when the moon is full, you will turn into a wolf. You know that.

And then there’s that moment when you’re sitting thinking, so what happens if a werewolf bites a goldfish?

Or what if the werewolf sinks its fangs into a chair? And what if you’re sitting in that chair and the moonlight touches it? Slowly it starts feeling more and more wolfish and it growls and what about the … you know? And oh my god! Then you’d have to set it in the winter, cuz you’d need the snow for people to try and figure out why you’ve got chair leg marks in the snow. By the body. That has its throat ripped out.

And suddenly, you have a story!

The whole video is funny, yet so full of wisdom.



P.S. Subscribe to my mailing list! P.P.S. Feed my insatiable reading habit.