-1

I am a python beginner. Trying to pass some command line arguments. I have used the following codes. But getting errors... transaction_file = argv[1] IndexError: list index out of range.

    import itertools
    import re
    from sys import argv


    print ('Computing frequent item sets.')
    transaction_file = argv[1]
    parameter_file = argv[2]
    output_file = argv[3]

Any help is greatly appreciated. Thanks......

Neepa
  • 29
  • 1
  • 2
  • 7

1 Answers1

-1

Supped of call:

python aaa.py a1 a2 a3

sys.argv len 4 -> sys.argv[3] return the value

or

python aaa.py a1 a2

sys.argv len 3 -> sys.argv[3] going in error

How you call the script?

znndrd
  • 79
  • 1
  • 8