Connecting flask to HTML

I have a flask application and an HTML webpage, part of Flask is already being rendered on the HTML webpage.

How ever I have subprocess lines in my Flask application that require user input.

I created forms and buttons to get the necessary information but am having trouble connecting them to my flask application.

SUBROCESS CODE

if __name__ == '__main__':
    newFile = input ("type the name of the file you would like to use with the extension as well: ")

    subprocess.run(['python3', 'validateMe.py', '-i', newFile])

    fileCategory = input("input the category that this file falls under: ")
    subprocess.run(['python3', 'readMe.py', '-i', newFile, '-o', fileCategory])

    fileModel = (fileCategory + "_model")
    SEARCH = Search(fileModel)

HTML FORMS AND BUTTONS


<div class="row" style="margin-top: 32px" align="center">
    <h4>Choose and Upload a file</h4>
    <input id="file-input" type="file" name="newFile" />
    <form>

        <p>
          <input type = "text"
                 id = "myFILE"
                 name = "newFile2" required
                 placeholder="Please enter file name with extension (i.e. file_data.xlsx)"
                 size= "70" />
                 <button>Submit</button>
        </p>
    </form>

    <form>

          <p>
            <input type = "text"
                   id = "myCategory"
                   name = "fileCategory" required
                   placeholder="Please enter file data set category"
                   size= "70" />
                   <button>Submit</button>
          </p>
      </form>

</div>

As a side note, I have put two input options for the newFile variable for My Flask's subprocess commands in my HTML file (newFile and NewFile2) as I am unsure which would be the best way to extract the file name