I have written code to generate numbers from 0500000000 to 0500000100:

```
def generator(nums):
    count = 0
    while count < 100:
        gg=print('05',count, sep='')
        count += 1  
g = generator(10)

```

as I use linux, I thought I may be able to use this command `python pythonfilename.py >> file.txt`

Yet, I get an error.

So, before `g = generator(10)` I added:

```
with open('file.txt', 'w') as f:
    f.write(gg)
    f.close()

```

but I got an error:

> 
> TypeError: write() argument must be str, not None
> 
> 
> 

Any solution?