str.split() is so well known, but a simple step beyond leaves a lot of pythonistas lost: how do you split without breaking up embedded strings? How do you split "1 '2 3' 4" into ['1', '2 3', '4']? Why, shlex.split("1 '2 3' 4"), of course! The shlex module is a lexical analyzer and includes this little useful utility for us.
I’ve been spending a good deal of the last two days preparing mentally for starting a whole new challenge as a developer. New things aren’t new to me, but this is different and big enough really call for some Deep Thoughts ™. For one thing, I’ve made a big move from the world of Python web development to totally other Python work and while web development has never been the only thing I do, it has been the only work that paid the bills. That transition isn’t one that bothers me or daunts me, though. Instead, I’m thinking about transitioning to the scope of the work I’m getting into. For a long time, I juggled multiple clients and client projects every day, so no single project usually took up most of my time. Every developer juggles time through the day, but exactly how that works in each company and on each project varies a lot. I was looking for a place that I could really focus in a way that I haven’t for a long time. I think I found that, but now I have to deal with the consequen...
Comments
larry