I got myself an old EEE PC for exactly that purpose. (Except, substitute python with lua).
8h battery life, cost me €20 and does what it's supposed to. Just make sure you get one with an Atom N280 or better. The popular N270 is 32bit only, and more and more programs are dropping 32bit support. Some of them you can DIY compile for 32bit, some you really don't want to.
(For example, compiling Node on an Atom N270 takes around 3 days.)
I had one with an N270 first and replaced it with one with an N450 to get 64bit.
Maxed it out with 2GB RAM, a cheapo €10 SSD that maxes out SATA and overclocked it to 2GHz.
It's not fast by any stretch of the imagination, but it's totally ok for editing text files with Kate and compiling with platformio.