# Python Techniques for Batch Files, Context Managers, and Command-Line Arguments

DevFeed: [Python Techniques for Batch Files, Context Managers, and Command-Line Arguments](<https://devfeed.tech/articles/a-heaping-helping-of-python-goodness-32195.md>)

Original publisher: [Read original article](<https://bruceeckel.com/2014/12/05/a-heaping-helping-of-python-goodness/>)

Author: Bruce Eckel

Published: 2014-12-05T00:00:00Z

Content type: tutorial

Language: en

Sources: [Bruce Eckel - Computing Thoughts](<https://devfeed.tech/sources/bruce-eckel-computing-thoughts.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Batch file](<https://devfeed.tech/topics/batch-file.md>), [Windows](<https://devfeed.tech/topics/windows.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [batch](<https://devfeed.tech/tags/batch.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [python](<https://devfeed.tech/tags/python.md>), [windows](<https://devfeed.tech/tags/windows.md>)

## AI overview

A tutorial-style article describing Python techniques for repetitive tasks, including running a Python program from a Windows batch file, using a context manager to restore a working directory, and command-line arguments.

## Source excerpt

I really enjoy solving problems quickly and thoroughly. I especially enjoy solving annoying, repetitive problems that invite human error. The icing on the cake is when I learn some new tricks in the process. This last few days was a flurry of problem-solving and trick-learning. My favorite tricks are small bits of learning that make code easier to write, read and use. A couple of these are Windows-specific but most are general.