■
[python]ひな形。
import sys import re import numpy as np import struct import array import math #import matplotlib.pyplot as plt #from decimal import Decimal, ROUND_HALF_UP args = sys.argv argc = len(args) if argc < 2: print("This program is for.......") print("USAGE: python test.py test.txt ") sys.exit(0) path = args[1] with open(path) as f: for line in f: line = line.rstrip('\n') parts = line.split() outpath = re.sub(r'\..*',"_result.txt",path) with open(outpath, mode='w') as f: |<