I'm making a macro in python and I need some help.
Basically, it just loads up 4 line entries from a text file and just attaches those 4 things to the end of a URL, and opens firefox to that URL. It then waits a random time between 3min-8min and terminates firefox and loops again.
I think i did something wrong because I'm trying to run it and its not running.
import os,sys import random import webbrowser import time import subprocess as sp cls=os.system("cls") title=os.system('title Hit any key to start searhing!') def main(): cls print "" title raw_input() getRandEntry() def getRandEntry(): #this function gets 4 random line entries from wordlist.txt WordList = open("wordlist.txt","r") randomEntry1 = random.choice(WordList.readlines()) randomEntry2 = random.choice(WordList.readlines()) randomEntry3 = random.choice(WordList.readlines()) randomEntry4 = random.choice(WordList.readlines()) WordList.close() startLink() def startLink(): QuadEntry = randomEntry1 + "+" + randomEntry2 + "+" + randomEntry3 + "+" + randomEntry4 child = sp.Popen(['firefox', '-p', 'myprofile', '-no-remote', "http://swagbucks.com/?t=w&p=1&q=" + `QuadEntry`]) time.sleep(15) child.terminate() #where taskkill for python goes for interval in range(180, 481): #180 seconds = 3 mins, 480 seconds = 8 min #for loop is to make the random 3min-8min interval between searches time.sleep(interval) getRandEntry()