SHARE
TWEET

Untitled

a guest Jul 17th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2.  
  3. i   = 0
  4.  
  5. argc = len(sys.argv)
  6. if argc == 1:  
  7.                 f   = sys.stdin
  8. elif argc == 2:
  9.                 try:   
  10.                                 f   = open(sys.argv[1], "r")   
  11.                 except FileNotFoundError:  
  12.                                 sys.exit("wc:   No  such    file    or  directory,",    sys.argv[1])   
  13. else:  
  14.                 sys.exit("usage:    wc  [file]")
  15.  
  16. while True:
  17.                 s   = f.readline()
  18.                 if not  s:  break
  19.                 print(s.replace(s[2], "*"))
  20. f.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top