Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Create files of the desired size

Project description



Create files of the desired size.

Simple example:

$ fwrite testfile 100M


Install using pip:

pip install fwrite


Download and set executable permission on the script file:

chmod +x


Download and run using the python interpreter:



Usage: fwrite filename size [options]

create files of the desired size, e.g., 'fwrite test 10M'

--version       show program's version number and exit
-h, --help      show this help message and exit
-r, --random    use random data (very slow)
-n, --newlines  append new line every 1023 bytes


Create file “test” with 100KB:

$ fwrite test 100K

Create file “test” with 1GB:

$ fwrite test 1G

Create file “test” with 10MB of random data:

$ fwrite test 10M -r

Create file “test” with 10MB of random data with lines:

$ fwrite test 10M -r -n


  • Works on Python 2 and Python 3
  • Tested on Linux and Windows

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for fwrite, version 0.3
Filename, size File type Python version Upload date Hashes
Filename, size fwrite-0.3.tar.gz (2.6 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page