Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been running a python script from the command line that's inserting data in a database for a couple of hours now. It will take at least half a day more before it's finished. However, I want to take the laptop with me to somewhere else. My sleep at closing lid settings (if they exist) are at default (I've never looked at them). If I close the lid and open it in 4 or 5 hours, will the python script resume from where it left off? If not, can this be set to work in the preferences somehow?

share|improve this question
up vote 1 down vote accepted

It should continue, if your script has any error-handling for loosing connection to the database (assuming off-site DB).

Though the exact behaviour is hard to predict without seeing the actual code. Sleeping the system may also leed to unexpected results in the script.

share|improve this answer
Thanks. It's a local database, so connection is not a problem. – Niek Nov 6 '12 at 12:09
@Niek - so you are testing this for all of us. Can you post your results? :) – carbontax Nov 6 '12 at 12:19
@carbontax it continued where it left off after I opened it again – Niek Nov 6 '12 at 16:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.