Re: Code critique please

2015-04-09 Thread Peter Otten
kai.pet...@gmail.com wrote: > I just wrote this bit (coming from Pascal) > if (((xdim / 8) * ydim) + header) <> filesize: Yeah, either Pascal or Barry Warsaw is your uncle ;) https://www.python.org/dev/peps/pep-0401/ > and am wondering how seasoned > Python programmers would have done the

Re: Code critique please

2015-04-08 Thread Jean-Michel Pichavant
- Original Message - > From: "kai peters" > To: python-list@python.org > Sent: Wednesday, 8 April, 2015 12:43:23 AM > Subject: Code critique please > > I just wrote this bit (coming from Pascal) and am wondering how > seasoned Python programmers would have done the same? Anything > terrib

Re: Code critique please

2015-04-08 Thread Robert Kern
On 2015-04-08 01:54, Mark Lawrence wrote: On 07/04/2015 23:43, kai.pet...@gmail.com wrote: I just wrote this bit (coming from Pascal) and am wondering how seasoned Python programmers would have done the same? Anything terribly non-python? As always, thanks for all input. import os, sys from PI

Re: Code critique please

2015-04-07 Thread Mark Lawrence
On 07/04/2015 23:43, kai.pet...@gmail.com wrote: I just wrote this bit (coming from Pascal) and am wondering how seasoned Python programmers would have done the same? Anything terribly non-python? As always, thanks for all input. import os, sys from PIL import Image, ImageFont, ImageDraw As

Re: Code critique please

2015-04-07 Thread kai . peters
On Tuesday, 7 April 2015 15:43:44 UTC-7, kai.p...@gmail.com wrote: > I just wrote this bit (coming from Pascal) and am wondering how seasoned > Python programmers would have done the same? Anything terribly non-python? > > As always, thanks for all input. > > K > > > > """ > Creates a PNG i

Re: Code critique please

2015-04-07 Thread Cameron Simpson
On 07Apr2015 15:43, kai.pet...@gmail.com wrote: I just wrote this bit (coming from Pascal) and am wondering how seasoned Python programmers would have done the same? Anything terribly non-python? As always, thanks for all input. K """ Creates a PNG image from EPD file """ import os, sys from

Re: Code critique please

2015-04-07 Thread Chris Kaynor
On Tue, Apr 7, 2015 at 3:43 PM, wrote: > I just wrote this bit (coming from Pascal) and am wondering how seasoned > Python programmers would have done the same? Anything terribly non-python? > > As always, thanks for all input. > > K > > > > """ > Creates a PNG image from EPD file > """ > > imp

Re: Code critique please

2015-04-07 Thread Ian Kelly
On Tue, Apr 7, 2015 at 4:43 PM, wrote: > def RenderByte(draw, byte, x, y): Python function and method names customarily use the lowercase_with_underscores style. > blist = list(bin(byte).lstrip('0b')) # turn byte into list with 8 > elements, There's no guarantee that the resulting list wi