Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone help me debug my python code in the main function. There are red underlines that need to be fixed. aggregator.py x 21 def
Can someone help me debug my python code in the main function. There are red underlines that need to be fixed.
aggregator.py x 21 def main): 23 24 25 26 27 28 29 30 31 32 # read command line, filename, topic filename sys.argvl-1] # read file, line by line with open (filename) as f: content f.readlines() for line in lines: # for each line, pull contents from web using urllib if len(sys.argv)-3: print("Error: Invalid arguments") print("Usage:aggregator.py filename topic") file open (sys.argv [1] ,''r") out sys.argv [2] +"sources.txt" file1 open (out,"w") for line in file: 34 35 36 37 38 39 40 41 42 43 try: response = urllib.urlopen (line) content response.read() count0 for linel in content: ust-line1. split (">") List = list [1] . split("Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started