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 kai.pet...@gmail.com 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

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

Code critique please

2015-04-07 Thread kai . peters
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 PIL import Image, ImageFont, ImageDraw #

Re: Code critique please

2015-04-07 Thread Ian Kelly
On Tue, Apr 7, 2015 at 4:43 PM, kai.pet...@gmail.com 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

Re: Code critique please

2015-04-07 Thread Chris Kaynor
On Tue, Apr 7, 2015 at 3:43 PM, 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

Re: Code critique please

2015-04-07 Thread Cameron Simpson
On 07Apr2015 15:43, kai.pet...@gmail.com 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

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 image from EPD

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

Re: Learning Python: Code critique please

2008-06-22 Thread Saul Spatz
macoovacany wrote: http://macoovacany.wordpress.com/ When I tried to run it, I got all kinds of syntax errors because of non-ASCII characters; namely, you have fancy left and right single and double quotes. Once I replaced these with the ASCII equivalents, it worked fine. I suggest you use a

Re: Learning Python: Code critique please

2008-06-22 Thread William McBrine
On Sun, 22 Jun 2008 08:44:25 -0500, Saul Spatz wrote: macoovacany wrote: http://macoovacany.wordpress.com/ When I tried to run it, I got all kinds of syntax errors because of non-ASCII characters; namely, you have fancy left and right single and double quotes. That's probably WordPress'

Learning Python: Code critique please

2008-06-21 Thread macoovacany
Hello all, I'm trying to learn various programming languages (I did MATLAB at uni), and have decided to start with Python. The programming exercises are derived from Larry O'brien's a href=http://www.knowing.net/ PermaLink,guid,f3b9ba36-848e-43f8-9caa-232ec216192d.aspx15 Programming Exercises

Re: Learning Python: Code critique please

2008-06-21 Thread macoovacany
http://macoovacany.wordpress.com/ -- http://mail.python.org/mailman/listinfo/python-list