title: How can I assign the value from the slider to a variable? I can only use .get() to print the output, not store it
body: <p>I need it to store the value of the slider in a variable, say <code>v</code> when the button is clicked. For context, I need this so I can have a slider that sets the starting amount of money for my poker game A level project.</p>
  
  <pre><code>from tkinter import * 
  
  root = Tk()
  
  def show_values():
      print (w.get()) #would I put it in this function?
  
  canvas = Canvas(root, width = 700, height = 200, bg = "blue")
  w = Scale(root,from_=0, to=200,length = 200, orient=HORIZONTAL,bg = "green")
  Button(root, text='Show', command=show_values).pack() 
  w.pack()
  canvas.pack()
  
  mainloop()
  </code></pre>