Пример #1
0
def main():
    # Allows specification of a target account that is not Kevin Bacon.
    if len(sys.argv) == 3:
        h.TARGET_ACCOUNT = sys.argv[2]

    # Grab some of the keywords and hashtags relevant to the target account.
    h.preprocess(twitter)

    print("Running...")
    # Begin execution by looking at queries.
    sequence = handlePercepts()

    # Print the found sequence of tweets
    print
    print
    for tweet in sequence:
        uprint(tweet)
Пример #2
0
def numberCode(code) :
	# Apply preprocessers
	code = preprocess(code)

	result = []
	temp = code.split("\n")
	for i in range(len(temp)) :
		result.append(str(i+1)+"\t"+temp[i])
	return "\n".join(result)
Пример #3
0
def numberCode(code):
    # Apply preprocessers
    code = preprocess(code)

    result = []
    temp = code.split("\n")
    for i in range(len(temp)):
        result.append(str(i + 1) + "\t" + temp[i])
    return "\n".join(result)
Пример #4
0
	return cfg

# Check if the file is run directly
if(__name__ == '__main__') :
	# Declare options for the parsing with the file
	optparser = OptionParser()
	optparser.add_option('-f', '--inputFile',
			dest='inFile',
			help='filname of the source file',
			default=None)

	# Parse the option available with input
	(options, args) = optparser.parse_args()

	# Grab the source code
	code = None
	if(options.inFile is None) :
		code = sys.stdin
	elif(options.inFile is not None) :
		code = dataFromFile(options.inFile)
	else :
		print("No file specified, system will exit")
		sys.exit("System will exit")

	# Apply preprocessors to the code
	code = preprocess(code)

	# Obtain CFG of code
	cfg = codeToCFG(code)
	for i in cfg : print i