Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40159

Re: Issue with continous incrementing of unbroken sequence for a entire working day

From John Gordon <gordon@panix.com>
Newsgroups comp.lang.python
Subject Re: Issue with continous incrementing of unbroken sequence for a entire working day
Date 2013-02-28 19:23 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <kgoar7$db1$1@reader1.panix.com> (permalink)
References <CAJ2vgs6zZpHC_p=SuE7QWf7NDvokMjmE1N-aEN3a6n_DXi2=aQ@mail.gmail.com> <CAB3fQDVxmO9mX4HDCDXr0Pa5HF462uPL8csLfrcMUCNC3WrikA@mail.gmail.com> <mailman.2663.1362078015.2939.python-list@python.org>

Show all headers | View raw


In <mailman.2663.1362078015.2939.python-list@python.org> Morten Engvoldsen <mortenengv@gmail.com> writes:

> But, if i save the serial_ number value in file, then how  will it decide
> to reset the serial number to '1' when the batch  runs on next working day.

Name the file so that it contains the date, i.e. "serial_numbers.2013-02-28".

If the file exists, you know that the program has already run today and
you can read the file to obtain the previous serial number.

If the file does not exist, you know the program has not yet run today
and you can start the serial number at 1.

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Issue with continous incrementing of unbroken sequence for a entire working day Morten Engvoldsen <mortenengv@gmail.com> - 2013-02-28 20:00 +0100
  Re: Issue with continous incrementing of unbroken sequence for a entire working day John Gordon <gordon@panix.com> - 2013-02-28 19:23 +0000
    Re: Issue with continous incrementing of unbroken sequence for a entire working day Chris Angelico <rosuav@gmail.com> - 2013-03-01 07:52 +1100

csiph-web