I've been reading up on threading and tried implementing it into my code however I'm not sure if the way I'm doing it, is the best practise.   My code simply imports a self scripted package which pulls weather data and runs the package every 60 seconds thereafter.   I plan on running multiple packages which gather data at once, when I have worked out a good code technique.  from package.weather import weatherapi import threading  def update():   weatherapi()   threading.Timer(60, update).start()  update()    Firstly it just seems messy and if I wanted more packages running in a thread, I'd need to create another update function Secondly I'm not able to kill my process   If anyone has any suggestions, it would be greatly appreciated.
I want to repeatedly execute a function in Python every 60 seconds forever (just like an  in Objective C). This code will run as a daemon and is effectively like calling the python script every minute using a cron, but without requiring that to be set up by the user.  In , the solution appears to effectively just  for x seconds. I don't need such advanced functionality so perhaps something like this would work  while True:     # Code executed here     time.sleep(60)   Are there any foreseeable problems with this code?
When I reinstall Windows XP by mistake I deleted all five partitions. I did not format them yet though.  How can I recover the partitions? When I attach the hard disk to another PC it just says that the partition is unformated and asks "Would you like to format it?". I have heard several times that some mathematician has given another and more rigorous for an established theorem, but I don't know what does it really mean and what differences makes it to be more 'rigorous'. My understanding of a proof is that a proof is some explanation to convincing others that a statement is true. If some proof is not rigorous, does it mean that while the proof is acceptable for many but it is not for everybody? If so, the proof is not correct since it going to be rejected by some people and it is not a proof at all. Or, does rigorous mean it uses more advanced tools? If so, why not any alternative (but simpler) proof is also acceptable as rigorous (which is more 'valuable' as well since it's simpler!)?   Saying those limited insight of mine, my questions are:   $1-$ What does rigorous proof mean, in general definition?  $2-$ In order to understand your answers, as an example I am re-writing three of the proofs for the compactness of the torus. Which of the following proofs are most rigorous, 'normal' and least rigorous; and why so?    Theorem: The torus $T^2$ is compact.  First proof: The torus is homeomorphic to the product space $S^1 \times S^1$. The circle $S^1$ is compact. Therefore the torus is the product of two compact spaces, and thus it is compact.   Second proof: The torus $T$ is the subspace of $\mathbb{R}^3$ obtained by rotating a circle about the $z$-axis. The torus is closed since given any point in its complement, there is an open ball of sufficiently small radius centered at that point and disjoint from the torus. Also, the torus is bounded since it is contained in the ball of radius $4$ centered at the origin. Since the torus is closed and bounded in $\mathbb{R}^3$, it is compact.   Third proof: The torus is homeomorphic to a space obtained as a quotient  space of the square by identifying opposite edges. The square is a closed and  bounded subset of $\mathbb{R}^3$ and therefore is compact. Furthermore, a quotient map on the square is a continuous function, and the image of a compact space under a continuous function is compact. Therefore the torus is compact.   Thanks a lot for your guidance. Unable to set DYLD_FALLBACK_LIBRARY_PATH in shell on OSX 10.11.1 In shell scripts used for unit testing with dynamic libraries in a directory other than the typical @rpath, I have previously been able to set DYLD_FALLBACK_LIBRARY_PATH to set the directory containing the libraries. Under 10.11.1, bash seems to ignore attempts to set this environment variable:  $ sh -x testscript.sh + DYLD_FALLBACK_LIBRARY_PATH=/Users/something/testinglibs + export DYLD_FALLBACK_LIBRARY_PATH + exec printenv   and DYLD_FALLBACK_LIBRARY_PATH is not present in printenv's output.  Is this a security-related hack in 10.11's shell? I haven't been able to find this change documented in man pages or online. What is the fastest way to get from Courmayeur/Aosta to Milan? How to execute a script just by double clicking like .EXE files in Windows? How can I make a bash script executable by double clicking just like .exe files in Windows? I tried , but there are two consequences:   the terminal twinkles, disappears, and nothing is done. you must specify to run in terminal in order to work.   I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu.  Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how? If a function $f : \mathbb Z\times \mathbb Z \rightarrow \mathbb{R}^{+} $ satisfies the following condition  $$\forall x, y \in \mathbb{Z}, f(x,y) = \dfrac{f(x + 1, y)+f(x, y + 1) + f(x - 1, y) +f(x, y - 1)}{4}$$  then is $f$ constant function? Variance of sum of $k$ randomly drawn numbers from $1,...,n$. Finite choice without AC Can anyone explain how we choose one sock from each of finitely many pairs without the axiom of choice?  I mean : To choose one sock from each of infinitely many pairs of socks requires the Axiom of Choice, but for shoes the Axiom is not needed.  The idea is that the two socks in a pair are identical in appearance, and so we must make an arbitrary choice if we wish to choose one of them. For shoes, we can use an explicit algorithm -- e.g., "always choose the left shoe." Why does Russell's statement mention infinitely many pairs? Well, if we only have finitely many pairs of socks, then AC is not needed -- we can choose one member of each pair using the definition of "nonempty," and we can repeat an operation finitely many times using the rules of formal logic (not discussed here). How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE? Example of a relation that is symmetric and transitive, but not reflexive Can you give an example of a relation that is symmetric and transitive, but not reflexive?   By definition,   $R$, a relation in a set $X$, is reflexive if and only if $\forall x\in X$, $x\,R\,x$.  $R$ is symmetric if and only if $\forall x, y\in X$,  $x\,R\,y\implies y\,R\,x$. $R$ is transitive if and only if $\forall x, y, z\in X$, $x\,R\,y\land y\,R\,z\implies x\,R\,z$.    I can give a relation $\leqslant$, in a set of real numbers, as an example of reflexive and transitive, but not symmetric. But I can't think of a relation that is symmetric and transitive, but not reflexive. What is the difference between a population and a sample? What is the difference between a population and a sample? What common variables and statistics are used for each one, and how do those relate to each other? Random real numbers that sum up to specific value Recommend MVVM or just answer the question? Defining macros with arguments With newcommand I can define customized command like \ABC. Is there any way to define a command with arguments. For example I want \brat{A}{B} be the same as [\![A,B]\!]. I read this story a long time ago and cannot remember either the title or the author. It was written in the 60s or 70s. The setting is sometime in the 21 century.  Here is a summary of the plot.  One of the great classical composers (maybe it was Schubert, I'm not sure) is revived with some future technology. All the guys in the lab are very happy about it, the world cheers the achievement. The composer is also quite excited to be alive. Naturally, he is asked to perform a concert. He asks for ink and music paper. Nobody knows what that is: in those days everybody writes music directly in "frequency spectrum" and similar stuff.  The composer, excited to create music again, tries to come up with something but he doesn't like anything he writes. The music is well written, but lacks something essential, it doesn't sound like his real music. Finally, the composer realizes that the lab guys recreated his mind from reviews by music critics, and his music just sounds like that. He performs the concert. The audience enjoys it, applauds and bravos. Not only to composer, but also to the lab guys.   At the end, if I remember it right, the composer gloats over the  primitive taste of the audience. The audience who writes music in frequency spectrum and applauds to lab guys at the music concert did not see the failure in the concert and ate it as it is.  Does someone recognize the story?  PS all the recent talk of advent of AI machines with Machine Learning algorithms reminded me of this story. System Load Indicator only shows as a line unless hovered I installed the  GNOME extension on my Ubuntu 18.04, but for some reason, instead of showing a proper graph for CPU usage, it only shows a very thin line that seems to be a small portion of the actual graph. If I hover over it, the proper graph shows. How to make it show the whole graph all the time? json parse error with double quotes Is it possible to somehow mark a System.Array as immutable.  When put behind a public-get/private-set they can't be added to, since it requires re-allocation and re-assignment, but a consumer can still set any subscript they wish:  public class Immy {     public string[] { get; private set; } }   I thought the readonly keyword might do the trick, but no such luck. How to modify an invalid '/etc/sudoers' file? What is the difference between `grep`, `egrep`, and `fgrep`? Can anyone tell me the technical differences between grep, egrep, and fgrep and provide suitable examples?  When do I need to use grep over egrep and vice versa?