A note I looked up to make a command line tool in Python

I use shell scripts for the work I often do at work. I think that making it a shell script has the following advantages.

A shell script is fine, but I wanted to be able to write the script more efficiently and debug the script itself, but my friend recommended Python, so I studied it.

First impression about Python

I think Python is similar to Swift. It also has a wealth of language features and libraries. I think that what is similar to Swift is that Swift imitated it. If you know Swift, you'll soon be able to use Python. And vice versa, if you know Python, you'll soon be able to use Swift. It's easy to make a mistake when the reserved words are different even though the functions are similar.

Required modules

The tasks you want to automate are:

To do these in Python, it seems like you can use the "os", "json", "xml.dom", and "subprocess" modules. Python has a lot of modules, so I think most things can be written using the functions of the modules provided.

What used to be hard-coded as a shell script is a language that makes it easier to use by allowing it to be specified in configuration files and command line options for command line tools.

Recommended Posts

A note I looked up to make a command line tool in Python
Try to make a command standby tool with python
I tried to make a stopwatch using tkinter in python
I want to make input () a nice complement in python
I created a password tool in Python.
[5th] I tried to make a certain authenticator-like tool with python
[2nd] I tried to make a certain authenticator-like tool with python
[Python] I tried to implement stable sorting, so make a note
[3rd] I tried to make a certain authenticator-like tool with python
How to get a string from a command line argument in python
[4th] I tried to make a certain authenticator-like tool with python
[1st] I tried to make a certain authenticator-like tool with python
Create a command line tool to convert dollars to yen using Python
How to receive command line arguments in Python
I want to create a window in Python
I want to make a game with Python
Make a rock-paper-scissors game in one line (python)
[Python] I tried to make a simple program that works on the command line using argparse.
Build a command line app in Python to understand setup.py, argparse, GitHub Actions
How to manage arguments when implementing a Python script as a command line tool
Python program is slow! I want to speed up! In such a case ...
I tried to implement what seems to be a Windows snipping tool in Python
I set up TensowFlow and was addicted to it, so make a note
Tool to make mask image for ETC in Python
I want to embed a variable in a Python string
I want to easily implement a timeout in python
Try to make a Python module in C language
Specify a subcommand as a command line argument in Python
I tried to implement a pseudo pachislot in Python
I want to work with a robot in python.
Things to note when initializing a list in Python
[Python] I want to make a nested list a tuple
How to execute a command using subprocess in Python
I implemented a Vim-like replacement command in Slackbot #Python
Make a bookmarklet in Python
I want to write a triple loop and conditional branch in one line in python
Command line tool to put .gitkeep in an empty directory
I tried to implement a one-dimensional cellular automaton in Python
I made a command to generate a table comment in Django
I tried "How to get a method decorated in Python"
I want to send a message from Python to LINE Bot
Create a tool to check scraping rules (robots.txt) in Python
Make python segfault in one line
Hit a command in Python (Windows)
In the python command python points to python3.8
I tried Line notification in Python
When I got a list of study sessions in Python, I found something I wanted to make
How to make a string into an array or an array into a string in Python
I tried to make a regular expression of "amount" using Python
I created a Python library to call the LINE WORKS API
I tried to make a regular expression of "time" using Python
I tried to make a regular expression of "date" using Python
I wrote a function to load a Git extension script in Python
I tried to implement a misunderstood prisoner's dilemma game in Python
I tried to make a 2channel post notification application with Python
[Introduction] I want to make a Mastodon Bot with Python! 【Beginners】
I want to make the second line the column name in pandas
I tried to make a todo application using bottle with python
[Python] Simple Japanese ⇒ I tried to make an English translation tool
I made a command to display a colorful calendar in the terminal
I tried to implement PLSA in Python