Created
January 26, 2016 05:14
-
-
Save ilivessevili/8338697d75a26240b20e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
1GB = 1024*1024*1024 # 1GB | |
with open('large_file', 'wb') as fout: | |
fout.write(os.urandom(1GB)) |
wrong variable name: Python variables can not start with numbers.
As was mentioned before, python doesn't accept that var begin with numbers, but thank you for the main idea.
This is not work for Windows if size is over than size_t value in C.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think python doesn't allow variable name like 1GB? better to use GB1.