tkinter get selection radiobutton
<p>How can I append the priority  of this application to the file as seen in the code below?</p>

<pre><code>    #Option boxes for assigning a priority level to the request
    priority = StringVar()
    Radiobutton(self.f4, text = "High", variable=priority, value="1").grid(row = 4, column = 1, sticky = W)
    Radiobutton(self.f4, text = "Low", variable=priority, value="2").grid(row = 6, column = 1, sticky = W)


    #Button for "Confirm application"
    self.app_con = Button(self.f4, text=" Confirm and finish ", command=self.apphistory)
    self.app_con.grid(row=4, column=2


def apphistory(self):
    fo = open("Application_History.txt", "a")
    fo.writelines(["Priotiry: "+str(priority.get()),"\n"])
    fo.close
</code></pre>

<p>Have you tried changing </p>

<blockquote>
  <p>variable=priority</p>
</blockquote>

<p>to </p>

<blockquote>
  <p>variable=self.priority</p>
</blockquote>

<p>This way, the Radiobutton knows where to search for the variable (in your program / class) instead of looking for it in the Radiobutton-Class itself.</p>

<p>And as mentioned in the comments, you need to create the variable</p>

<blockquote>
  <p>self.priority</p>
</blockquote>

python tkinter