I was wondering if declaring a variable inside a function, then use it with an object would make it a global variable def re():     re.termine = False     re.rect_circle_switch = True     re.case1_disponible = True     re.case2_disponible = True     re.case3_disponible = True     re.case4_disponible = True     re.case5_disponible = True     re.case6_disponible = True     re.case7_disponible = True     re.case8_disponible = True     re.case9_disponible = True  if rect.rec_1.collidepoint(pos) and re.case1_disponible==True:                 if re.rect_circle_switch == True :                     pygame.draw.line(fenetre,noir,(50,50),(150,150),10)                     pygame.draw.line(fenetre,noir,(142, 56),(51, 145),10)                                          re.rect_circle_switch = False   I assume that it will still be local after using it, but i don't really understand how scoping works in python
What exactly are the Python scoping rules?  If I have some code:  code1 class Foo:    code2    def spam.....       code3       for code4..:        code5        x()   Where is x found?  Some possible choices include the list below:   In the enclosing source file In the class namespace In the function definition In the for loop index variable Inside the for loop   Also there is the context during execution, when the function spam is passed somewhere else. And maybe  pass a bit differently?  There must be a simple reference or algorithm somewhere.  It's a confusing world for intermediate Python programmers.
On this link (Sentinel1  for a SLC product), the resolution is written as a range from the highest corresponding to low incidence angle, to the lowest resolution corresponding to high incidence angle.  My question is how is the resolution related in general to the incidence angle? And if they are really related, why is the resolution affected by the change in the incidence angle? To quantize a scalar field theory with the action:  $$S=\int \mathrm d^Dx\mathscr{L}(\phi,\partial_\mu\phi)=\int \mathrm dx^0L(\phi,\partial_0\phi)$$  we promote $\phi(\vec{x})$ and $\pi=\frac{\delta L}{\delta(\partial_0\phi)}=\pi(\vec{x})$ to be field operator at fixed time $x^0$ (with the canonical commutation relation $[\phi(\vec{x}),\pi(\vec{y})]=\delta^{D-1}(\vec{x}-\vec{y})$), then we use the classical equation of motion to find $\phi$ and $\pi$ at all time.  What principles lie behind this? Why can we assume that the field operators satisfy the classical equation of motion?    By example if we have a classical theory with $S=\int \,\mathrm dtL(\phi,\partial_t\phi)$, momentum $\pi=\frac{\delta L}{\delta(\partial_t\phi)}$ hamiltonian $H=\pi\phi-L$, the classical equation of motion is:  $$\frac{\mathrm d\phi}{\mathrm dt}=\frac{\delta L}{\delta(\partial_t\phi)}$$  When we do the canonical quantization, we promote $[\phi,\pi]=\delta(\vec{x}-\vec{y})$ and the equation of motion for $\phi$ is $$\frac{\mathrm d\phi}{\mathrm dt}=i[H,\phi]$$  Why should $i[H,\phi]$ has the same form as $\frac{\delta L}{\delta(\partial_t\phi)}$? This fact comes from where? Classification of groups of order 12 I have a lot of difficulty understanding this proof we went over in class about classification of groups of order 12.  Let $G$ be a finite group of order $n=p^rm$ where $m \nshortmid p$.  Denote $Syl_p(G)$ as the set of all sylow p-subgroups, and $n_p(G)$ as the cardinality of $Syl_p(G)$.  (1) G has subgroups of order $p^r$. (How do we know this??)  (2) We know all sylow p-groups are conjugate and their number $n_p(G) | m$, by the 2nd and 3rd Sylow Theorems.  (3) We have that $n_p(G) \equiv 1(p). $  Then $n=12=2^2*3^1$ so $n_2(G)|3$ gives $n_2(G) \in \{1,3\}$ and $n_3(G)|4$ so $n_3(G) \in \{1,4\}$ since $2 \not\equiv 1(3)$.  Case 1: $n_3(G) = 4.$ Then the action of G by conjugation on $Syl_3(G)$ gives a homomorphism $f: G \rightarrow S_{Syl_3(G)} \simeq S_4$. $Ker(f)$ consists of $g \in G$ that normalizes all 3-Sylow subgroups. (Why?). Let $P_3$ be a 3-Sylow subgroup. Then the order of $P_3$ is 3. (I don't get that either), and $[G:N_G(P_3)] = 4.$ Thus $P_3 \subset N_G(P_3)$ gives $P_3 = N_G(P_3)$. (I'm lost here...) So $Ker(f) = \cap Syl_3(G) = \{e\}$ (the intersection of the sylow 3-subgroups is trivial. (How did we arrive here...) Thus we conclude that $G$ is isomorphic to a subgroup of $S_4$ of order 12.  To show $G$ is isomorphic to $A_4$, we have that $G$ has 8 elements of order 3: 4 3-sylow subgroups each has 3-1=2 elements of order 3. And $S_4$ has 8 3-cycles meaning f(G) contains all 3-cycles and hence the group they generate, which is $A_4$, so $A_4 \subset f(G)$. But since $|A_4| = 12 = |f(G)$ then $f(G) = A_4$ and $G \simeq A_4$. (Not understanding the first half of the proof, I do not get this part either).  Case 2: $n_3(G) = 1.$ The scope of the question is too large, I will need to post separately to understand the second half, unless the organizational rules of math.stackexchange would require that I post here. In that case, I'll edit the question.  I basically cannot follow the proof because it seems to skip too many steps; it would be helpful if anyone could elaborate case 1 with more reasoning so that I can follow it. Any help would be appreciated; I've spent hours trying to look up and decipher the proof but without any success. How much does it cost to have a custom ASIC made? I have browsed several ASIC manufacturer's webs, but I haven't found an actual number. I assume there would be a fixed cost associated with creating masks and such and then there will be a cost per unit.     Note: that I don't actually want to have an ASIC made, I'm just curious. I'm trying to set an RSA key as an environment variable which, as a text file, contains newline characters.  Whenever I attempt to read from the file and pass it into an environment variable, it will just stop at the newline character on the first line. How can I prevent this? Remove empty directory from CVS? Is the following equivalent to the axiom of choice? When transiting Moscow (SVO), citizens of which countries need a transit visa? Which is correct “Is that yours?” or “Is that your’s?”?  I ask because it is possessive, so I would think it would be the latter, but I typically use and see the former usage.  Are there particular cases in which one should be used instead of the other? Or is one simply correct and the other not?  This is one of the few things that still confuse me, so help is greatly appreciated. How to color particles based on the texture of the object from which they are emitted, using the "grid" emission setting? If $\tan(\frac{\pi}{4}+\frac{y}{2})=\tan^3(\frac{\pi}{4}+\frac{x}{2})$,then prove that $\sin y=\frac{\sin x(3+\sin^2 x)}{(1+3\sin^2 x)}$ If $\tan(\frac{\pi}{4}+\frac{y}{2})=\tan^3(\frac{\pi}{4}+\frac{x}{2})$,then prove that $\sin y=\frac{\sin x(3+\sin^2 x)}{(1+3\sin^2 x)}$    $\tan(\frac{\pi}{4}+\frac{y}{2})=\tan^3(\frac{\pi}{4}+\frac{x}{2})$ $\frac{1+\tan\frac{y}{2}}{1-\tan\frac{y}{2}}=(\frac{1+\tan\frac{x}{2}}{1-\tan\frac{x}{2}})^3$ Applying componendo and dividendo rule on both sides, $\tan\frac{y}{2}=\frac{\tan\frac{x}{2}(3+\tan^2\frac{x}{2})}{(1+3\tan^2\frac{x}{2})}$ I am stuck here. Load a table with NO geometry_column using PyQGIS Wilson and Fermat's Theorem What is difference between a ring and a field? Conditional Formatting: 3 color scale showing text relevance in Excel for Mac Is there a way to use conditional formatting in the following manner in Excel? (For those who are curious, I am using Excel 2010 for Mac)  I want Cell B2 to be green when A2 says "John likes green apples" and B2 also says "John likes green apples", yellow if A2 says "John likes green apples" and B2 says "Bill likes blue apples", and red if A2 says "John likes green apples" and B2 says "Bill hates red oranges".  I am just wondering if there is a way to something to that effect.  Thanks How to convert string to byte array in Python Proof that the One-Dimensional Simple Harmonic Oscillator is Non-Degenerate? The standard treatment of the one-dimensional  (SHO) using the raising and lowering operators arrives at the countable basis of eigenstates $\{\vert n \rangle\}_{n = 0}^{\infty}$ each with corresponding eigenvalue $E_n = \omega \left(n + \frac{1}{2}\right)$. Refer to this construction as the abstract solution.  How does the abstract solution also prove uniqueness? Why is there only one unique sequence of countable eigenstates? In particular, can one prove the state $\vert 0\rangle$ is the unique ground state without resorting to coordinate representation? (It would then follow that the set $\{\vert n \rangle\}_{n = 0}^{\infty}$ is also unique.)  The uniqueness condition is obvious if one solves the problem in coordinate representation since then one works in the realm of differential equations where uniqueness theorems abound. Most textbooks ignore this detail (especially since they often solve the problem both in coordinate representation and abstractly), however I have found two exceptions:   Shankar appeals to a theorem which proves one-dimensional systems are non-degenerate, however this is unsatisfactory for two reasons:   Not every one-dimensional system is non-degenerate, however a general result can be proven for a large class of potentials (the SHO potential is in such a class). The proof requires a departure from the abstract solution since it classifies the potentials according to their functional properties.  Griffiths addresses this concern in a footnote stating that the equation $a \vert 0\rangle = 0$ uniquely determines the state $\vert 0\rangle$. Perhaps this follows from the abstract solution, however I do not see how. What is the correct formula for gravitational time dilation for a satellite in a circular orbit? In the Wikipedia article on  I see two formulae for the gravitational time dilation. One contains $\sqrt{1 - r_0/r}$ but the other $\sqrt{1 - 1.5 r_0/r}$. What formula should I use to calculate the time dilation due to gravity inside a satellite? The speed induced time dilation is of course just special relativity.  With the first of these two formulas I can perfectly reproduce the graphs on time dilation as a function of $r$,  I find that the two contributions to time dilation cancel at 1.5 Earth radii, all numbers are OK... But why not the second formula? Find all solutions to $x^2\equiv 1\pmod {91},\ 91 = 7\cdot 13$ What happened to the Grid at the end of Tron Legacy?