From d219732cf9da8283b27e99f11b871376fb65e18f Mon Sep 17 00:00:00 2001 From: mutto233 <39921339+mutto233@users.noreply.github.com> Date: Fri, 29 Jun 2018 15:53:39 -0400 Subject: [PATCH] More Commit tests --- Channel_Sorter - Copy (2).py | 26 ++++++++++++++++++++++++++ Channel_Sorter - Copy (3).py | 26 ++++++++++++++++++++++++++ Channel_Sorter - Copy (4).py | 26 ++++++++++++++++++++++++++ Channel_Sorter - Copy.py | 26 ++++++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 Channel_Sorter - Copy (2).py create mode 100644 Channel_Sorter - Copy (3).py create mode 100644 Channel_Sorter - Copy (4).py create mode 100644 Channel_Sorter - Copy.py diff --git a/Channel_Sorter - Copy (2).py b/Channel_Sorter - Copy (2).py new file mode 100644 index 0000000..4040468 --- /dev/null +++ b/Channel_Sorter - Copy (2).py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 26 23:31:00 2018 + +@author: Matt +""" +import re +import sys + +def atoi(text): + return int(text) if text.isdigit() else text + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [ atoi(c) for c in re.split('(\d+)', text) ] + +temp_hold = list(sys.argv[1:]) +temp_hold.sort(key=natural_keys) +file = open('Channels_Sorted.txt','w') +for item in temp_hold: + file.write(item + '\n') +file.close() \ No newline at end of file diff --git a/Channel_Sorter - Copy (3).py b/Channel_Sorter - Copy (3).py new file mode 100644 index 0000000..4040468 --- /dev/null +++ b/Channel_Sorter - Copy (3).py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 26 23:31:00 2018 + +@author: Matt +""" +import re +import sys + +def atoi(text): + return int(text) if text.isdigit() else text + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [ atoi(c) for c in re.split('(\d+)', text) ] + +temp_hold = list(sys.argv[1:]) +temp_hold.sort(key=natural_keys) +file = open('Channels_Sorted.txt','w') +for item in temp_hold: + file.write(item + '\n') +file.close() \ No newline at end of file diff --git a/Channel_Sorter - Copy (4).py b/Channel_Sorter - Copy (4).py new file mode 100644 index 0000000..4040468 --- /dev/null +++ b/Channel_Sorter - Copy (4).py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 26 23:31:00 2018 + +@author: Matt +""" +import re +import sys + +def atoi(text): + return int(text) if text.isdigit() else text + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [ atoi(c) for c in re.split('(\d+)', text) ] + +temp_hold = list(sys.argv[1:]) +temp_hold.sort(key=natural_keys) +file = open('Channels_Sorted.txt','w') +for item in temp_hold: + file.write(item + '\n') +file.close() \ No newline at end of file diff --git a/Channel_Sorter - Copy.py b/Channel_Sorter - Copy.py new file mode 100644 index 0000000..4040468 --- /dev/null +++ b/Channel_Sorter - Copy.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +""" +Created on Tue Jun 26 23:31:00 2018 + +@author: Matt +""" +import re +import sys + +def atoi(text): + return int(text) if text.isdigit() else text + +def natural_keys(text): + ''' + alist.sort(key=natural_keys) sorts in human order + http://nedbatchelder.com/blog/200712/human_sorting.html + (See Toothy's implementation in the comments) + ''' + return [ atoi(c) for c in re.split('(\d+)', text) ] + +temp_hold = list(sys.argv[1:]) +temp_hold.sort(key=natural_keys) +file = open('Channels_Sorted.txt','w') +for item in temp_hold: + file.write(item + '\n') +file.close() \ No newline at end of file