Can someone explain to me how to test the program that I am writing in my command line? For example, I have to create a program that takes two or three parameters (an optional first parameter) and I am trying to create error messages for those who will be using the program but when I put in my parameters I don't get any message.
My program should print an error message and quit if: the inputfile does not end with .genes the outputfile does not end with .fa or .fasta
I have written in wings...
def extractGenes(variable,input,output): variable = False if '-s' in sys.argv: variable = True if not input.endswith(".genes"): print("Incorrect file type.") sys.exit(1) if not output.endswith(".fa") or output.endswith(".fasta"): print("Incorrect file type.") sys.exit(1)
I think this should work? but when I go to the putty command line to test it by writing
python extractGenes.py (myinputfile) (myoutputfile), nothing happens.