Python Forum
[split] Any improvements
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] Any improvements
#1
I design a code Python Program Code for Sort File In System : -
#!/usr/bin/env python

from __future__ import print_function  # Only for Python < 3; but harmless

import sys

from collections import Counter

 

data = Counter()

data.update([line.strip() for line in sys.stdin.readlines()])

print('\n'.join(['%s\t%s' % (y,x)  for x,y in data.most_common(20)]))


User has been warned for this post. Reason: Hijacked thread, clickbaiting
Reply
#2
Don't post links like those in the forum, it is not tolerated
pyzyx3qwerty
"The greatest glory in living lies not in never falling, but in rising every time we fall." - Nelson Mandela
Need help on the forum? Visit help @ python forum
For learning more and more about python, visit Python docs
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Improvements for first script? alloydog 9 4,102 Jan-01-2021, 02:50 PM
Last Post: perfringo
  Any improvements Chuck_Norwich 2 2,518 Jul-14-2020, 05:15 AM
Last Post: Gamo
  Coding improvements chris_drak 2 30,616 May-02-2020, 11:39 AM
Last Post: chris_drak

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020