Python Forum
looking 4 py code: file byte/character frequency
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
looking 4 py code: file byte/character frequency
#1
the command line argument would be a filename in the coding used by the host system.  if the given name is what the platform normally uses to designate reading standard input or is missing, then the input will be stdin.  each byte/character of input will be counted, based on separate counters for each value.  output will be after end of file on input.  output will spell out the frequency of each byte/character of input and will show that frequency in some order sorted either by the byte/character value or the frequency count.

the code should work under python 3 as a minimum.  it can be made to work under both python 2 and python 3 by any known method of doing that (such as version checks), or by having separate code for each.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
looking 4 py code: file byte/character frequency - by Skaperen - Jan-20-2017, 05:08 AM

Forum Jump:

User Panel Messages

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