python 将unix文件转成dos文

发布时间:2019-09-06 08:57:35编辑:auto阅读(1855)

    #!/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()

关键字