python 将unix文件转成dos文

2023-01-31 05:01:23 python 文件 转成

#!/usr/bin/python
#-*-encoding:UTF-8-*-


import sys


if len(sys.argv) < 2:
print('Usage : Python sys.argv[0] FileName')
sys.exit(1)
else:
print ('\nunix2dos.py execution successfully!\n')


File=sys.argv[1]
fileobj = open(File,'rU')
try:
allfile = fileobj.read()
finally:
fileobj.close()

相关文章