diff options
author | cajun-rat <p@beta16.co.uk> | 2017-07-05 14:50:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-05 14:50:37 +0200 |
commit | 00dc1fef0667ab640ad6bd688e4737309b000358 (patch) | |
tree | c9e4c89bce12a81ddd364b2676c8a005fff725dd /recipes-test/big-update/files/rand_file.py | |
parent | b0d9d7018502a29f062895f853efd41e7b760d5a (diff) | |
parent | 69a0db9291725b1ddfa643dc00d6d2f1bf6c5caf (diff) | |
download | meta-updater-00dc1fef0667ab640ad6bd688e4737309b000358.tar.gz |
Merge pull request #101 from advancedtelematic/feat/mergemorty
Merge current progress from morty to pyro
Diffstat (limited to 'recipes-test/big-update/files/rand_file.py')
-rw-r--r-- | recipes-test/big-update/files/rand_file.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/recipes-test/big-update/files/rand_file.py b/recipes-test/big-update/files/rand_file.py new file mode 100644 index 0000000..0f4f16e --- /dev/null +++ b/recipes-test/big-update/files/rand_file.py | |||
@@ -0,0 +1,16 @@ | |||
1 | import sys | ||
2 | from random import seed, randint | ||
3 | |||
4 | def main(): | ||
5 | n = int(sys.argv[2]) | ||
6 | ba = bytearray(n) | ||
7 | |||
8 | seed(42) | ||
9 | for i in range(0, n): | ||
10 | ba[i] = randint(0, 255) | ||
11 | |||
12 | with open(sys.argv[1], 'wb') as f: | ||
13 | f.write(bytes(ba)) | ||
14 | |||
15 | if __name__ == "__main__": | ||
16 | main() | ||