Sort_By_Columns:Python 2

时间:2021-07-02 02:56:02
【文件属性】:
文件名称:Sort_By_Columns:Python 2
文件大小:3KB
文件格式:ZIP
更新时间:2021-07-02 02:56:02
Python Sort_By_Columns Python 2.7:“一个程序,它的第一个参数是输入文件的名称(例如包含的“testfile.txt”),第二个参数是按升序排序的主要列,第三个参数作为次要要排序的列(也按升序排列)”。 因此,如果计算机上安装了 Python 2.7,并且如果您在命令行中输入了“SortByColumns.py”和“textfile.txt”文件所在的目录: > python SortByColumns.py testfile.txt Gender Name The output file would be: ID Name Gender Age EMP5 Dana F EMP2 Sally F 30 证明: 如何使用 DictReader 从制表符分隔的文件中将文件读入字典 如何对字典进行排序 如何使用 DictWriter 将字典输出到输出文件中的表
【文件预览】:
Sort_By_Columns-master
----SortByColumns.py(3KB)
----sorted_testfile.txt(127B)
----testfile.txt(112B)
----README.md(796B)
----.gitattributes(483B)

网友评论