searching for a word in a file using command argument? in python3, popping up no answers
Question: trying to write a program that searches the dictionary file for words which
start with the first command line argument, which is their stem but I'm
getting nothing.

here's my code, what am I doing wrong?

    
    
    import sys
    import os
    
    stem = str(sys.argv[1:])
    searchline = open("american-english-insane")
    for line in searchline:
     if line.startswith(stem):
      print(word)
    

On the other hand, this works and spits out hello, helloes, helloeing, etc...
but it's not passed as a command line argument.

    
    
    import sys
    import os
    
    stem = sys.argv[1:]
    searchline = open("american-english-insane")
    for line in searchline:
     if line.startswith('hello'):
      print(line)
    


Answer: Use a below snippet, which returns a string object

    
    
    stem = sys.argv[1]
    

