Skip to content

Instantly share code, notes, and snippets.

@mpge
Created December 9, 2013 18:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpge/7877598 to your computer and use it in GitHub Desktop.
Save mpge/7877598 to your computer and use it in GitHub Desktop.
Quick python-based Matrix script. (Not advanced because requirement is to run on multiple platforms/systems).
#!/usr/bin/python
import os
import subprocess
# use if using string.letters
# import string
import random
# uncomment and install for colors
# from termcolor import colored
def main():
# uncomment for colors
# color = "#4A7023"
characters = "10"
# characters = string.letters
# How long?
cols = 75
# For loop
while True:
# define final_string
final_string = ""
for x in range(0, cols):
# for colors
# print colored(random.choice(characters))
randomchoice = random.choice(characters)
# add to final_string
final_string += randomchoice
# print final_string (full string with {cols} length of characters
print (final_string)
# print new line
print("\n")
# main
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment