Skip to content

Instantly share code, notes, and snippets.

@possatti
Created May 28, 2014 16: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 possatti/2e0d71607a6dfdee90ed to your computer and use it in GitHub Desktop.
Save possatti/2e0d71607a6dfdee90ed to your computer and use it in GitHub Desktop.
Inicia um programa que fica invocando outras janelas do gnome-terminal que fazem exatamente a mesma coisa. :|
from subprocess import call
import random
random.seed()
cyclesCount = 0
cyclesToCreateNewInstance = 9999
sentence = "All work and no play makes Jack a dull boy"
def createNewInstance():
call(["gnome-terminal", "-x", "python", "dull-boy.py"])
while True:
print sentence
cyclesCount += 1
if cyclesCount == cyclesToCreateNewInstance:
createNewInstance() # Dangerous line! :)
cyclesCount = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment