Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.026 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; '1000.': 0.09; 'filed': 0.09; 'record.': 0.09; 'def': 0.10; 'increment': 0.16; 'subject: \n ': 0.16; 'subject:entire': 0.16; 'subject:Issue': 0.17; 'team,': 0.18; 'python?': 0.20; '\xa0so': 0.22; 'runs': 0.22; 'second': 0.24; 'message-id:@mail.gmail.com': 0.27; 'run': 0.28; 'reset': 0.29; "skip:' 10": 0.30; 'code': 0.31; 'could': 0.32; 'print': 0.32; 'received:74.125.82': 0.33; 'to:addr :python-list': 0.33; 'received:google.com': 0.34; 'sequence': 0.35; 'continue': 0.35; 'next': 0.35; 'received:74.125': 0.36; 'subject:with': 0.36; 'should': 0.36; 'throughout': 0.37; 'store': 0.38; 'to:addr:python.org': 0.39; 'day,': 0.60; 'first': 0.61; 'day.': 0.63; 'maximum': 0.63; 'series': 0.63; '10.': 0.64; 'serial': 0.66; 'subject:day': 0.66; 'records': 0.68; 'sales': 0.70; 'day': 0.73; '11.': 0.81; 'day,\xa0': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=nVFHI95ZcSqqbAJGgD64/+r15Wr7FkPvoMSZNo/B03A=; b=zXH51vSvAwKVuIyGGLNBviz4ye7KAfKgRIvVj+o0yiUJ1k7+/ww4aHekmHmTEpjm9S RVniqDqANNbY5UWR1Z+CUCh5OLhJiQYokztCxbGuD7LXb0bC9E5jqU/nALsSrzPmRUg7 CLegpwF1oSEH93w8rr4DNCQLN8DPAus821iHu6C5n1zFZxJtF+xxM5dX1FyqE7vhxJ3x pgQUc/EFOyu8ZhDIenC3gr4U3oCgS1XwBaCHldzn8wsluGPcPpde3g1PmrY/M39FpGlg Cvvfwaeec1HHYqsa5cOM+UkneaYtktqvGGsQzrSKcUTHXzcJKVnA9DviZyJzwgfd6D7e 1icg== MIME-Version: 1.0 X-Received: by 10.180.103.161 with SMTP id fx1mr34201988wib.25.1362069118940; Thu, 28 Feb 2013 08:31:58 -0800 (PST) Date: Thu, 28 Feb 2013 17:31:58 +0100 Subject: Issue with continous incrementing of unbroken sequence for a entire working day From: Morten Engvoldsen To: python-list@python.org Content-Type: multipart/alternative; boundary=f46d04428892fe7d8104d6cb6dcd X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 67 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362069139 news.xs4all.nl 6869 [2001:888:2000:d::a6]:58978 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40136 --f46d04428892fe7d8104d6cb6dcd Content-Type: text/plain; charset=ISO-8859-1 Hi team, I need to run a batch of sales records and the batch has serial_number filed to store the serial number of the sales record. The serial number should be set to 1 everyday when the batch runs first time in a day and the maximum serial number could be 1000. So when the batch runs first time in a day and if it has 10 records, so the last serial number will be 10. And when the batch runs 2nd time in same day, the serial number should start from 11. In this way serial_number will increment as an unbroken series throughout the entire working day. The next day when the batch runs first time the serial number will reset to 1. Now this could be sample code how the program can count the sequence for a batch: def salesrecord(): serial_number = 1 for i in selesrecord: print first_sales_record serial_number += 1 print serial_number salesrecord() So if the batch has 10 records and last serial number of first batch is 10, then when the batch runs second time in the same day, how the 'serial_number' will get the value of 10 and then continue the serial number for the same day, then for next day again the serial number will start from 1. Can you let me know how can i achive this in python? As i am in learning phase of python, can you let me know what would be good approach to do this in python. --f46d04428892fe7d8104d6cb6dcd Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi team,
I need to run a batch=A0of sales records and =A0the= batch has=A0serial_number filed to store the serial number of the sales re= cord. The serial number should be set to=A0=A01 everyday when the batch run= s first time in a day and the maximum serial number could be 1000.
=A0
So when the batch runs first time in a day=A0and if it h= as 10 records, so the last serial number will be 10. And when the batch run= s 2nd time in same day, the serial number should start from 11.=A0 In this = way serial_number will increment as an unbroken series throughout the entir= e working day. The next day when the batch runs first time the serial numbe= r will reset to 1.

Now this could be sample code how the program can count the sequence fo= r a batch:

def salesrecord():
=A0=A0=A0 serial_number =3D 1
= =A0=A0=A0 for i in selesrecord:
=A0=A0=A0=A0=A0=A0=A0 print first_sales_= record
=A0=A0=A0=A0=A0=A0=A0 serial_number +=3D 1
=A0=A0=A0=A0=A0=A0=A0 print serial_number

salesrecord()

So if= the batch has 10 records and last serial number of first batch is 10, then= when the batch runs second time in the same day, how the 'serial_numbe= r' will get the value of 10 and then continue the serial number for the= same day,=A0 then for next day again the serial number will start from 1.<= br>
Can you let me know how can i achive this in python? As i am in learnin= g phase of python, can you let me know what would be good approach to do th= is in python.
--f46d04428892fe7d8104d6cb6dcd--