Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.21.125.194
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib64 /
python2.7 /
Demo /
comparisons /
Delete
Unzip
Name
Size
Permission
Date
Action
README
2.28
KB
-rw-r--r--
2020-04-19 21:13
patterns
30
B
-rw-r--r--
2020-04-19 21:13
regextest.py
1.48
KB
-rwxr-xr-x
2024-04-10 04:57
regextest.pyc
1.06
KB
-rw-r--r--
2024-04-10 04:58
regextest.pyo
1.06
KB
-rw-r--r--
2024-04-10 04:58
sortingtest.py
1.23
KB
-rwxr-xr-x
2024-04-10 04:57
sortingtest.pyc
1.02
KB
-rw-r--r--
2024-04-10 04:58
sortingtest.pyo
1.02
KB
-rw-r--r--
2024-04-10 04:58
systemtest.py
2.23
KB
-rwxr-xr-x
2024-04-10 04:57
systemtest.pyc
1.56
KB
-rw-r--r--
2024-04-10 04:58
systemtest.pyo
1.56
KB
-rw-r--r--
2024-04-10 04:58
Save
Rename
#! /usr/bin/python2.7 # 2) Sorting Test # # Sort an input file that consists of lines like this # # var1=23 other=14 ditto=23 fred=2 # # such that each output line is sorted WRT to the number. Order # of output lines does not change. Resolve collisions using the # variable name. e.g. # # fred=2 other=14 ditto=23 var1=23 # # Lines may be up to several kilobytes in length and contain # zillions of variables. # This implementation: # - Reads stdin, writes stdout # - Uses any amount of whitespace to separate fields # - Allows signed numbers # - Treats illegally formatted fields as field=0 # - Outputs the sorted fields with exactly one space between them # - Handles blank input lines correctly import re import sys def main(): prog = re.compile('^(.*)=([-+]?[0-9]+)') def makekey(item, prog=prog): match = prog.match(item) if match: var, num = match.groups() return int(num), var else: # Bad input -- pretend it's a var with value 0 return 0, item for line in sys.stdin: items = sorted(makekey(item) for item in line.split()) for num, var in items: print "%s=%s" % (var, num), print main()