蛙の井戸見聞記 Pretty frog in a well who knows nothing of the great web ocean!

~~ 好奇心は猫をも殺す Curiosity Kills the Cat ~~ ♪欲しいモノ・食べたいモノ・ネットで集めた情報と日々の記録の倉庫♪ Logging my life... Since 2003.12  

[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:
 |<