#!/usr/bin/env python3
# encoding: utf-8
import itertools as it
import time
import math
import shutil
## ## ## STEP 1: Get Inputs, includes a 3 second timeout, and using default name if enter is pressed without typing ## ## ## -----------------------------------------------
inputFileName = ""
def prompt_with_timeout(): # This function gives you 3 seconds to interrupt before using a default file name, Outro
from time import sleep
print('\n\t You have 3 seconds to ctrl + C, and rename the input source, or by default will use Intro.txt to generate')
try:
for i in range(0, 3): # 30 minutes is 30*60 seconds, 3 is three seconds
sleep(1)
print("//")
inputFileName = "Intro.txt"
except KeyboardInterrupt:
inputFileName = input("which .txt file to read word lists from? : ")
return inputFileName
def choose_wordset(): ############################### UNFINISHED """"
print(" \n Randomly generate a word set")
print(" which language to use as?")
lang = input
if inputFileName == "": prompt_with_timeout()
if inputFileName == "":
print ("\t > defaulting to Intro.txt as no input recieved")
inputFileName = "Intro.txt"
nameCheck = inputFileName[-4:]
if nameCheck != ".txt":
inputFileName = inputFileName + ".txt"
print (" \n ", " opening ", inputFileName, "\n")
lineNos=0
with open(inputFileName, 'r') as f:
for line in f:
lineNos += 1
print("> Total number of items to scramble is ----> ", lineNos, "\n", "\n")
permuteLengthMin = int(input("What is the MINimum permutation length you seek eg 12 permutations (not combinations!) :\n "))
permuteLengthMax = int(input("\nWhat is the MAX permutation length you seek eg 20 permutations: \n"))
totalSeeds = total_seeds(permuteLengthMin,permuteLengthMax,nf,lineNos)
print ("There will be a total of ", totalSeeds, "seed combinations to create, taking around ",totalSeeds/420000, " seconds")
# open the list from file specified and ignore the \n at the end
with open(inputFileName) as f:
wordlist = f.read().splitlines()
print ("\t RESULTS in " + oName + "\n")
Доброго времени суток! Ребята помогите настроить скрипт пожалуйста. Он работает Идеально за исключением вывода результата прямо в другую программку. Кто подскажет что написать и добавить?