Exemple #1
0
def StartSolveThread(any):
    timeStr = 'Something that won\'t format'
    while not Funcs.Isfloat(timeStr):
        timeStr = GetStrInput("Max computation time: ")
    miscGlobal.start = time.process_time()
    miscGlobal.maxTime = float(timeStr)

    # try:
    _thread.start_new_thread(SolveLoadedPath, ("", ""))
Exemple #2
0
def Parse(lines: str):
    locations = []
    lines = lines.splitlines()
    #Parse all lines with only numbers and '.'s to instances of 'Location'
    for line in lines:
        if line.replace('\n', '', 1000).replace(' ', '', 1000) == '':
            continue
        #If all the characters in this line, are contained within 'validLocationChars'
        # if all(validLocationChars.__contains__(char) for char in line):
        if all(
                Funcs.Isfloat(word) for word in line.split()
        ):  #If everything on this line can be converted into a float, then it is a location
            #All characters in this line are contained within 'validLocationChars'
            #This is a location
            locations.append(Location.ParseStringToLocation(line))
        else:
            #Atleast one character in this line are not contained within 'validLocationChars'
            #This is not a location
            if miscGlobal.specialPrint == True:
                print(line.strip())  #This might be useful information
    if miscGlobal.specialPrint == True:
        print()
    return locations