Watch your health. Being unhealthy can make you want to choose easier (lazier) tasks. Also, make sure you sleep well (not just long enough, but of high enough quality) since poor sleep can lead to laziness and diminished stress tolerance. I would recommend meditation or playing an instrument if the problem appears to be having too many things going on mentally at once.
Also, entertainment items give near-instant gratification and often very high stimulation. If you have been exposed to a lot of these lately, it may be necessary to stay away from excess stimulation for a while before you can adjust to the calmness of programming. Going straight to software would be like walking out of a concert and into a quiet library. Taking a long walk in a peaceful place could help.
The trick afterward is to avoid the urge for instant gratification.