Anyone else having trouble with actually sitting down to write? I have a good topic but I'm finding it hard to make time for writing. After I look after my responsibilities, I don't have much impetus left.

@bradfonseca I find it really hard. Last year I tried to write one post per week, and gave myself permission to have 4 weeks off. I did OK, and now when I'm trying to get one every two weeks it feels more relaxed.

Picking one from the long list is hard. I wrote some Python to just pick one at random and I write about that for a minimum of 10 minutes. Sometimes I then discard it and pick another, sometimes I discard it and quit for the day, sometimes I keep going, and it's done.

But it's hard.

I like your idea of randomly picking a topic and just writing on that for 10 minutes to see where it goes. My challenge is having a big enough list to choose from.

I'd love to see your Python code for the topic randomizer.

@bradfonseca Choose random line from given file in Python 2:


import random,sys

line = 'No lines given!'
p = 1.0
n = 1
filename = sys.argv.pop(0)
while sys.argv:
filename = sys.argv.pop(0)
handle = file(filename)
this_line = handle.readline()
while this_line:
r = random.random()
if r<p:
line = this_line
p = 1.0/n
this_line = handle.readline()

print line,

Not exemplary code, but does the trick.


@bradfonseca Here is an incomplete list of things I might blog about:

There are extras there too that need culling, but there's plenty to choose from.

I don't try to be profound, I just share stuff I know and hope that some people find it interesting.

· · Web · 0 · 0 · 1
Sign in to participate in the conversation

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!