Question: [IN PYTHON] I can't figure out how to go over multiple files at once to do this. We are recreating simple versions of unix tools

[IN PYTHON] I can't figure out how to go over multiple files at once to do this. We are recreating simple versions of unix tools and paste() is one. I need to iterate over 1 to many files so it can't be hard coded to expect a set number of files. I've gotten to joining multiple lists but just as [a,b,c,1,2,3] rather than something like [a,1,b,2,c,3]. I can't import anything just have to use built in simple python features, namely .join(). output should look something like this: Paste() joins two or more files together, inserting a comma in between $ python src/tt.py paste data/let3 data/num2 a,1 b,2 c, 

I need to write a program that accepts any number of arguments from sys.argv[].

It needs to read the files into a master file (i think) then I need to use the length of the longest file as the

times to iterate over and print each part of each file.

then it has to join() the indexes together with their counter parts from the other lists

so, if it's given 3 files. ill end up with 3 lists that i have to go over at the same time

list1 list2 list3
A

1

x
B 2 y
C 3 z

so the output would be along the lines of this:

A, 1, x

B, 2, y

C, 3, z

Thanks for the help

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!