Question: In python 3 write a program that reads from a text file and then creates an n number of smaller files based on the file

 In python 3 write a program that reads from a text

In python 3 write a program that reads from a text file and then creates an "n number of smaller files" based on the file size, without truncating sentences from the file. Function definition: def splitFile(fileName.n): Example: We have an ebook which has the size of 100 bytes and we want to cut it into 3 parts due to n = 3 but sometimes by dividing equally we might truncate part of the sentence within the ebook. We don't want that, we want to preserve the text so that all 3 files together makeup the ebook. So the resulting 3 files after we parse the file could be: Size File Name 34 bytes ebook.txt.000.txt 33 bytes ebook.txt.001.txt 33 bytes ebook.txt.002.txt Each file could be slightly bigger or smaller than the other file but we want them to be evenly as possible without ruining the text. You can essentially think that you're splitting the ebook up by chapters. We wouldn't cut part of the chapter out and put it into the other chapter

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!