ekkanh
0
Newbie Poster
Recommended Answers
Jump to PostDo you have the filenames in a file?
Do you want pipelining, stdout/stdin teeing?
Jump to Postdo you have the filenames in another file and want to read those filename one after the other and use the names to open the real files?????
more info needed ;)
Jump to PostThen modify the code like this
def thefunction(): filenames = list(x.strip() for x in list(open("name.txt", "rb")) if x.strip()) L = [(n, open(n, "rb").read()) for n in filenames] return [(x, [int(z) for z in y.strip().split()]) for (x,y) in L]
All 11 Replies
slate
241
Posting Whiz in Training
richieking
44
Master Poster
ekkanh
0
Newbie Poster
richieking
44
Master Poster
slate
241
Posting Whiz in Training
TrustyTony
888
pyMod
Team Colleague
Featured Poster
richieking
44
Master Poster
ekkanh
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
ekkanh
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.