Following up on,    Using threading, How can I get a script to run starting at 8:00 am stop running at 5:00 pm  The solution should be coded within python, and be portable  tiA
I'm looking for a library in Python which will provide at and cron like functionality.  I'd quite like have a pure Python solution, rather than relying on tools installed on the box; this way I run on machines with no cron.  For those unfamiliar with cron: you can schedule tasks based upon an expression like:    0 2 * * 7 /usr/bin/run-backup # run the backups at 0200 on Every Sunday  0 9-17/2 * * 1-5 /usr/bin/purge-temps # run the purge temps command, every 2 hours between 9am and 5pm on Mondays to Fridays.   The cron time expression syntax is less important, but I would like to have something with this sort of flexibility.   If there isn't something that does this for me out-the-box, any suggestions for the building blocks to make something like this would be gratefully received.  Edit I'm not interested in launching processes, just "jobs" also written in Python - python functions. By necessity I think this would be a different thread, but not in a different process.  To this end, I'm looking for the expressivity of the cron time expression, but in Python.   Cron has been around for years, but I'm trying to be as portable as possible. I cannot rely on its presence.
Ubuntu desktop suddenly points to home folder How did Montague Apparate into the Hogwarts bathroom? In year 5, Fred and George jam Montague into the Vanishing Cabinet. He's found weeks later in a toilet.      ‘He never managed to get all the words out,’ said Fred, ‘due to   the fact that we forced him head-first into that Vanishing Cabinet   on the first floor.’      […]      ‘They’ve found Montague, sir, he’s turned up jammed inside a toilet   on the fourth floor.’   ‘How did he get in there?’ demanded Snape.   ‘I don’t know, sir, he’s a bit confused.’   In year 6 Malfoy expands on that.      ‘I had to mend that broken Vanishing Cabinet that no one’s used for years. The one Montague got lost in last year.’      […]      ‘The other’s in Borgin and Burkes,’ said Malfoy, ‘and they make a kind of passage between them. Montague told me that when he was stuck in the Hogwarts one, he was trapped in limbo but sometimes he could hear what was going on at school, and sometimes what was going on in the shop, as if the Cabinet was travelling between them, but he couldn't make anyone hear him ... in the end he managed to Apparate out, even though he’d never passed his test. He nearly died doing it.   What happened here? Did he Apparate out into Hogwarts, Apparate into Borgin and Burkes and somehow wander back to Hogwarts and get stuck into a toilet? Does there currently exist a free online service that accepts a file, hashes it, takes an authoritatively chosen timestamp (from one or more time services), signs these and sends this signed message back? E.g. a digital notary, but only with regards to the timestamp and not the validity of the content as legal notaries might be obligated to guarantee.  Such a service might have an extremely simple API: Simply wget http://service/&lt;checksum&gt; and receive a signed message containing one or more timestamps and the checksum. The emphasis would be on the type of authority who might make such a service.  Edit: Although the original question did not emphasise the following, the Bitcoin-based timestamping services provided below do not rely on one authority, but rather the entire Bitcoin network. They can be seen as tamper-proof and verifiable without the help of the service that helped you sign it! How would I go about identifying a port, card or connector on my system which I am unfamiliar with?  Where would I find information on what these parts are? What would be the steps I would take in identifying a unknown port or cable?   This question comes up frequently, and the suggested solutions are usually the same. This community wiki is an attempt to serve as the definitive, most comprehensive answer possible. Feel free to add your contributions via edits. Correct usage of "see" vs. "watch" IDW Publishing are bringing out a , Assimilation2, set in ST:TNG (presumably the TNG in the timeline prior to the events of the 2009 movie) featuring the 11th Doctor.  Is the canon of these two universes at all compatible?  Both feature a lot of time travel, so we've seen the development of humanity through many centuries in the future.  Are there direct contradictions that make it impossible for these two universes to merge, without some sort of trick like having the Doctor come from an alternate universe?  Or, given the vast spread of time, is it possible that the events of the Star Trek stories have taken place between Doctor Who stories? Can a lambda function call itself recursively in Python? A regular function can contain a call to itself in its definition, no problem.  I can't figure out how to do it with a lambda function though for the simple reason that the lambda function has no name to refer back to.  Is there a way to do it?  How? I am playing a bit around with Qgis 2.14.6 to understand how it deals with distance measurement.  I took a line-shapefile that I saved in 3 different coordinate systems (4326, 32642 and a national one that doesn't exist in Qgis yet).  Using 32642 and the national one, the length is quite similar (6442m vs. 6428m)  But using 4326 (unprojected WGS84), I get 8057m  In all cases, I just used the Field Calculator and introduced $length.  I was already positively surprised that the result using 4326 was in meters and not in degrees.  To calculate the distance on the dataset in 4326, I assume that Qgis does some kind of re-projection in the background. Does anyone know which one?   Shapefiles here if anyone wants to play around:   EDIT - adding more info after more tests  As you can see, now both my shapefile and the project are in EPSG:4326, so unprojected:    Here the rough measurement of my shapefile, with the Qgis measure tool:   When I use the field calculator, the preview gives me a value in degrees, while the result seems to be in meters:      This would mean that the function $length, like the measurement tool, always gives a result in meters, but using a very coarse approximation of the degrees => meters transformation:    Is this a bug? or should it really behave like this? I find it at best counter-intuitive (but maybe it's just me) and, at worse, completely misleading (it makes very little sense to use, everywhere on earth, the length of 1 degree at the Equator). Any input or opinion here? Should I open a bug report (at least for the inconsistency between the preview and the actual result)? "He was neither seer nor prophet" How would you explain the absence of an article? Here's a fragment from Jack London's Star Rover:     Wordsworth knew. He was neither seer nor prophet, but just ordinary man like you or any man. What he knew you know, any man knows. But he most aptly stated it in his passage that begins "Not in utter nakedness, not in entire forgetfulness.   To the best of my — admittedly sketchy — knowledge of grammar, the second sentence should read neither a seer nor (a) prophet, but just an ordinary man. Even if we accept the seer and the prophet as "poetic entities" ("father and son," "robber and robbed," "man to man," or whatever), logic would still dictate that ordinary man should be preceded by an an.  It is a well-known fact that Jack London's usage wasn't always up to par; his grammar, on the other hand, was always top-notch.  Logically, the sentence is grammatically incorrect (correct me if I'm wrong: no pun intended).  Illogically, it reads smoothly: intuitively, a native speaker understands that there's nothing wrong here.  However, those to whom English is not the first language cannot be expected to be intuitive in this case and would want an explanation. Any suggestions? Regression - How do I know if my residuals are normally distributed? How to run Windows 10 from an external hard drive? I am currently able to boot from an external drive or multiboot USB. Taking this concept one step further, I have 3 questions:   1) Is it possible to install and run Windows 10 on a portable external hard drive or USB card with the same functionality of being installed on the internal drive?   2) Is it considered legal to do so or will it affect Windows updates in any way?   3) What are the steps to do that? (please outline steps I can follow so I don't lose a drive in the process). :)  EDIT: My question deals specifically with Windows 10, the legality and method of making it a standalone OS running from an external device and what effect if any it has on Windows Update; questions not dealt with in the other question. Set::setraw error in implementation of bisection method Prove that $$1+\frac{1}{3}+\frac{1\cdot 3}{3\cdot 6}+\frac{1\cdot 3\cdot 5}{3\cdot 6 \cdot 9}+.........=\sqrt{3}$$   $\bf{My\; Try::}$ Using Binomial expansion of  $$(1-x)^{-n} = 1+nx+\frac{n(n+1)}{2}x^2+\frac{n(n+1)(n+2)}{6}x^3+.......$$  So we get $$nx=\frac{1}{3}$$ and $$\frac{nx(nx+x)}{2}=\frac{1}{3}\cdot \frac{3}{6}$$  We get $$\frac{1}{3}\left(\frac{1}{3}+x\right)=\frac{1}{3}\Rightarrow x=\frac{2}{3}$$  So we get $$n=\frac{1}{2}$$  So our series sum is $$(1-x)^{-n} = \left(1-\frac{2}{3}\right)^{-\frac{1}{2}} = \sqrt{3}$$  Although I know that this is the simplest proof, can we solve it any other way someting like defining $a_{n}$ and then use Telescopic sum.  Thanks. I found this animal, which I suspect it's an insect, on the floor of a kitchen in Spain some days ago. It's about 8-10 mm long. I don't think I've ever seen it before. What is it? Evaluate $\lim_{x \to 0} (x\lfloor\frac{1}{x}\rfloor)$ Blog showing up as mobile, won't exit How should I install HPLIP binary/proprietary plugin/driver for my HP printer or printer+scanner? In our network the name of the network domain is also the domain of the organization's website (say, example.com). Externally, people can enter example.com to visit our website, but internally, this points to one of the several domain controllers, we have for Active Directory, some of which do not even run a webserver.   As a result of this, links to http://example.com don't work internally (only www.example.com does work internally).  How do we point http requests transparently to the web server, and what side effects does this have? Changing subject and verb positions in statements and questions How to enable read/write for windows partitions? With 11.04 I could read and write my partitions that was created in Windows however after upgrading to 11.10 somehow I can only read those partitions. How do I enable this ability in 11.10?