Create and write to new csv file during 'for' loop

The code below is intended to create a csv file called 'file-0.csv' and start writing lines by iterating through the for loop until it reaches 100 lines. When the limit is reached, it should stop writing to 'file-0.csv', create 'file-1.csv', and continuing the for loop where it left off, start writing to 'file-1.csv' until it reaches 100 lines, and so on until the for loop is complete.

The actual behavior of the code below (complete, and executable) is that it creates the new files as expected (4 total), but it continues to write all lines to 'file-0'....

### Function/subroutine that creates new CSV file with incremented filename
def new_file():
### Make the variable 'fileCounter' usable by the function
global fileCounter
### Add 1 to 'fileCounter'
fileCounter += 1
### Create new CSV file using the value of 'fileCounter' as part of the name
with open('file-' + str(fileCounter) + '.csv', 'w') as csvfile:
rowWriter = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_NONE)

######################
#### Main Program ####
######################

### Create initial CSV file using the value of 'fileCounter' as part of the name
with open('file-' + str(fileCounter) + '.csv', 'w') as csvfile:
### Create writer object and define how it should behave
rowWriter = csv.writer(csvfile, delimiter=',', quoting=csv.QUOTE_NONE)