
import csv

class ThreeOhOne:
    def __ini__(self):
        pass


def main():
    threeOhOne = ThreeOhOne()

if __name__ == "__main__":
    main()


import sys
import csv

class ThreeOhOne:
    outputDir = 'outputs'

    def __init__(self, filename):
        self._process(sys.argv[1])

    def _process(self, filename):
        try:
            fd = open(filename, 'rt')


        except FileNotFoundError:
            print('Error: File not found ;/')


def main():
    if len(sys.argv) < 2:
        print("usage: " + sys.argv[0] + " <the_file.csv>")
        exit(1)
    else:
        threeOhOne = ThreeOhOne(sys.argv[1])

if __name__ == "__main__":
    main()

Add command line argument capability
[py] Add command line argument capability

  
+ import sys
  import csv
  
  class ThreeOhOne:
+     outputDir = 'outputs'
+ 
-     def __ini__(self):
+     def __init__(self, filename):
-         pass
+         self._process(sys.argv[1])
+ 
+     def _process(self, filename):
+         try:
+             fd = open(filename, 'rt')
+ 
+ 
+         except FileNotFoundError:
+             print('Error: File not found ;/')
  
  
  def main():
+     if len(sys.argv) < 2:
+         print("usage: " + sys.argv[0] + " <the_file.csv>")
+         exit(1)
+     else:
-     threeOhOne = ThreeOhOne()
+         threeOhOne = ThreeOhOne(sys.argv[1])
  
  if __name__ == "__main__":
      main()
  
Add command line argument capability
## Code Before:

import csv

class ThreeOhOne:
    def __ini__(self):
        pass


def main():
    threeOhOne = ThreeOhOne()

if __name__ == "__main__":
    main()

## Instruction:
Add command line argument capability
## Code After:

import sys
import csv

class ThreeOhOne:
    outputDir = 'outputs'

    def __init__(self, filename):
        self._process(sys.argv[1])

    def _process(self, filename):
        try:
            fd = open(filename, 'rt')


        except FileNotFoundError:
            print('Error: File not found ;/')


def main():
    if len(sys.argv) < 2:
        print("usage: " + sys.argv[0] + " <the_file.csv>")
        exit(1)
    else:
        threeOhOne = ThreeOhOne(sys.argv[1])

if __name__ == "__main__":
    main()
