I was wondering how I could get it so the window for tkinter would close when a button is clicked, any help is appreciated. Below is part of my code.  def ynumber_chosen():     class number:         def __init__ (self, root):             root.title('Picking a row')             root.minsize(width = 3, height = 225)             root.maxsize(width = 3, height = 225)              label = Label(root, text = "Pick a row")              self.button1 = Button(root, text = "1", height = 3, width = 7, command = ynumber1)             self.button1.grid(row = 0, column = 1)             self.button1 = Button(root, text = "2", height = 3, width = 7, command = ynumber2)             self.button1.grid(row = 0, column = 3)             self.button1 = Button(root, text = "3", height = 3, width = 7, command = ynumber3)             self.button1.grid(row = 2, column = 1)             self.button1 = Button(root, text = "4", height = 3, width = 7, command = ynumber4)             self.button1.grid(row = 2, column = 3)             self.button1 = Button(root, text = "5", height = 3, width = 7, command = ynumber5)             self.button1.grid(row = 3, column = 1)             self.button1 = Button(root, text = "6", height = 3, width = 7, command = ynumber6)             self.button1.grid(row = 3, column = 3)             self.button1 = Button(root, text = "7", height = 3, width = 7, command = ynumber7)             self.button1.grid(row = 4, column = 1)       root = Tk()     app1 = number(root)     mainloop()
How do I end a Tkinter program? Let's say I have this code:  from Tkinter import *  def quit():     # code to exit  root = Tk() Button(root, text="Quit", command=quit).pack() root.mainloop()   How should I define the quit function to exit my application?
"'key' is not valid for passed 'access_token', token not found" when trying to login using Google on Android SE app We want to find the solution $x$ to the congruence system  $$\begin{align} x &amp;\equiv r_1 \!\!\!\pmod{\!m_1}\\ x &amp;\equiv r_2 \!\!\!\pmod{\!m_2}\end{align},\ \ {\rm where}\ \  \gcd(m_1, m_2) = 1$$  These can be rewritten as  $$\begin{align} x &amp;= r_1 + m_1 j\\ x &amp;= r_2 - m_2k\end{align}$$  for unknown integers $j, k$. So we set those two equations as equal and rearrange them to  $$m_1j + m_2k = r_2 - r_1$$  Now assume we perform $\text{egcd}(m_1, m_2)$, which gives us the solution to  $$m_1u + m_2v = \gcd(m_1, m_2)$$  Let the integer $\,h\,$ make $\,h \gcd(m_1, m_2) = r_2 - r_1$.  Then $\qquad hm_1u + hm_2v = h\gcd(m_1, m_2) =  r_2 - r_1 = m_1j + m_2k$  At this point I am lost because I don't think we can just assume  $hm_1u = m_1j$ and extract $j = hu$.   How do I get the values of $j$ or $k$ so I can get the value of $x$? I tried to open Software Center using the command line   software-center   and it did work. I mean, Software Center opened and works fine, BUT, at the same time, in the Terminal window I see a lot of strange errors. How can that be? I'm puzzled.   Is there any explanation for this (and a fix for it)? I repeat, the app does open and it works fine, is only the lines in the background that show that something is not all right.  Here are the screen-shots with all the lines. I am new to the netplan on Ubuntu 18.04, just discovered it exists today. I have an interface that I am trying to add to create a floating IP on google cloud. It is based on this example:   I tested the example, and it works, but now I try to do the same on ubuntu, and I don't know how to convert this:  cat &lt;&lt; EOF &gt;&gt; /etc/network/interfaces auto eth0:0 iface eth0:0 inet static     address 10.190.1.1     netmask 255.255.255.255 EOF   to netplan.  The output for ls /etc/netplan is '50-cloud-init.yaml'. and the output for cat /etc/netplan/*.yaml is:  network:     version: 2     ethernets:         ens4:             dhcp4: true             match:                 macaddress: 42:01:0a:8e:00:3e             set-name: ens4   my ifconfig:  # ifconfig  ens4 ens4: flags=4163&lt;UP,BROADCAST,RUNNING,MULTICAST&gt;  mtu 1460     inet 10.142.0.62  netmask 255.255.255.255  broadcast 0.0.0.0     inet6 fe80::4001:aff:fe8e:3e  prefixlen 64  scopeid 0x20&lt;link&gt;     ether 42:01:0a:8e:00:3e  txqueuelen 1000  (Ethernet)     RX packets 9430  bytes 1635180 (1.6 MB)     RX errors 0  dropped 0  overruns 0  frame 0     TX packets 13383  bytes 1513428 (1.5 MB)     TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0   What is the equivalent of what he said to put in the file, for netplan? Difference between $\Delta$, $d$ and $\delta$ "To which", "by which", "on which" etc I have come across the phrases like "to which","for which", "by which", "on which" and so on(using a preposition with a relative pronoun).   e.g. The chair on which the body was found..  Could someone please explain if there's a particular rule to be followed when building/using them?   Can I use any preposition before 'which'?  What if I say "The chair which the body was found on"? How would I decide which preposition to be put? Can I use other relative pronouns too?  Thanks in advance. (a) Solve the equation $yu_x+xu_y=0$  with the condition $u(0,y) = e^{-y^2}$. (b) In which region of the xy plane is the solution uniquely determined?     I did the first part but I don't understand how to do part b.  I read   But I don't understand how the argument is based. A more clear explanation is appreciated LINQ's Distinct() on a particular property I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). What I if want to use  on a list of an Object on one or more properties of the object?  Example: If an object is Person, with Property Id. How can I get all Person and use Distinct on them with the property Id of the object?  Person1: Id=1, Name="Test1" Person2: Id=1, Name="Test1" Person3: Id=2, Name="Test2"   How can I get just Person1 and Person3? Is that possible?  If it's not possible with LINQ, what would be the best way to have a list of Person depending on some of its properties in .NET 3.5? A clarification in a limit While reading this  I do not understand that how can we claim that there exist a polynomial with the properties, even if it exist then how is it same for the function and the inverse. Is there a way to see my previous performances with respect to winter-bash? May be something like leagues for winter-bash? I understand that hats are different each year, but at least it would be nice to see the number of hats collected. Multiple outputs for beamer handouts I'm currently generating some presentations with beamer for students of my course. Some like to print the material, so I created a handout. Some students prefer to have 2,3,4,6 etc. pages per sheet of A4 paper. How can I go about to automatize the following code, so that it outputs 4 different files in 1x2,1x3,2x2,2x3 format?  I'd like to avoid having to compile it again everytime for the different formats.  \documentclass[a4paper]{article} \usepackage{pdfpages}  \begin{document} \includepdf[pages=1-last,nup=1x2,landscape=false,frame=true,             noautoscale=false,scale=1,delta=0mm 5mm]{Pres7Chap13-Handout.pdf} \end{document} How to preserve non-ASCII characters in ogr2ogr import? Allow moderators to refresh a user's network profile Currently, moderators have the ability to reset a user's username and/or profile text, and propagate that to the rest of the network, resetting it everywhere. However, often, the user's stackexchange.com network profile will also need to be reset, and this is currently only possible to do by either the user in question or staff.  Instead of bothering staff every time, moderators should have something available similar to chat, where moderators can change a user's parent site and have access to a "refresh profile" button, which will fetch updated information such as username and avatar from the parent site.  Currently, the only thing that moderators can do on stackexchange.com is to see hidden accounts. It would make sense for moderators to be able to refresh profiles there, like chat, and avoid pinging CMs every time this comes up. Solution of trigonometric equation $0 = x\cos(x)+2$ What is the name of the genre of games similar to Jetpack Joyride? When is double-quoting necessary? The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of $VARIABLE would throw off the shell.  I understand, however, that in more recent versions of shells, double-quoting is no longer always needed (at least for the purpose described above).  For instance, in bash:  % FOO='bar baz' % [ $FOO = 'bar baz' ] &amp;&amp; echo OK bash: [: too many arguments % [[ $FOO = 'bar baz' ]] &amp;&amp; echo OK OK % touch 'bar baz' % ls $FOO ls: cannot access bar: No such file or directory ls: cannot access baz: No such file or directory   In zsh, on the other hand, the same three commands succeed.  Therefore, based on this experiment, it seems that, in bash, one can omit the double quotes inside [[ ... ]], but not inside [ ... ] nor in command-line arguments, whereas, in zsh, the double quotes may be omitted in all these cases.  But inferring general rules from anecdotal examples like the above is a chancy proposition.  It would be nice to see a summary of when double-quoting is necessary.  I'm primarily interested in zsh, bash, and /bin/sh. Showing a set is nowhere dense in $C([0,1])$ The space $c_0$ of sequences that converge to 0 is not reflexive What type of path in shebang is more preferable? In scripts, first line should specify the path to interpreter. But on different servers Linux, Unix, or BSD this path could be different.  What is more preferable?  #!/usr/bin/env bash    or  #!/bin/bash If-else working, switch not