Re: Plz comment on this code

2010-09-20 Thread Steven D'Aprano
On Mon, 20 Sep 2010 19:33:45 +1200, Lawrence D'Oliveiro wrote: > WHAT_IF_SOMETHING_IS_INITIALLY_CONSTANT,_BUT_LATER_BECOMES_A > _CONFIG_VARIABLE,_OR_VICE_VERSA,_DOES_IT_NEED_TO_CHANGE_ITS_NAME? If you want to be compliant with PEP 8, then yes. -- Steven -- http://mail.python.org/mailman/list

Re: Plz comment on this code

2010-09-20 Thread Lawrence D'Oliveiro
In message , Alex Willmer wrote: > On Sep 19, 12:20 pm, Lawrence D'Oliveiro central.gen.new_zealand> wrote: >> In message >> , Alex >> >> Willmer wrote: >> > # NB Constants are by convention ALL_CAPS >> >> SAYS_WHO? > > Says PEP 8: > > Constants > >Constants are usually declared on a

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
On Sep 19, 12:20 pm, Lawrence D'Oliveiro wrote: > In message > , Alex > > Willmer wrote: > > # NB Constants are by convention ALL_CAPS > > SAYS_WHO? Says PEP 8: Constants Constants are usually declared on a module level and written in all capital letters with underscores separatin

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message <4c957412$0$3036$afc38...@news.optusnet.com.au>, fridge wrote: > digits=[zero,one,zero,one,zero,one,zero,one,zero,one] digits = [zero, one] * 5 > row_max=3 Defined but never used. > digit_i=int(inputted_digit[c]) > digit=digits[digit_i] > line+=digit[r] > line+=" " Too many

Re: Plz comment on this code

2010-09-19 Thread Lawrence D'Oliveiro
In message , Alex Willmer wrote: > # NB Constants are by convention ALL_CAPS SAYS_WHO? -- http://mail.python.org/mailman/listinfo/python-list

Re: Plz comment on this code

2010-09-19 Thread Alex Willmer
Your code works (assuming digits gets populated fully), but it's the absolute bare minimum that would. To be brutally honest it's: - unpythonic - you've not used the core features of Python at all, such as for loops over a sequence - poorly formatted - Please read the python style guide and follo

Re: Plz comment on this code

2010-09-19 Thread Peter Otten
fridge wrote: > # bigdigits2.py > > import sys > > zero=["***", >"* *", >"***"] > one=["***", > " * ", > "***"] > digits=[zero,one,zero,one,zero,one,zero,one,zero,one] > > inputted_digit=sys.argv[1] > column_max=len(inputted_digit) > row_max=3 > > r=0 > while r<3: > line="" > c

Re: Plz comment on this code

2010-09-18 Thread Steven D'Aprano
On Sun, 19 Sep 2010 12:23:15 +1000, fridge wrote: > # bigdigits2.py [snip code] It looks like Python. Did you have a specific question? P.S. Please don't send HTML to non-binary news groups, it's very annoying. And if you're sending it by email, your mail client appears to be broken, because i

Re: Plz comment on this code

2010-09-18 Thread Jason Swails
On Sat, Sep 18, 2010 at 10:23 PM, fridge wrote: > # bigdigits2.py > ^ Here is the comment > > import sys > > zero=["***", >"* *", >"***"] > one=["***", > " * ", > "***"] > digits=[zero,one,zero,one,zero,one,zero,one,zero,one] > > inputted_digit=sys.argv[1] > column_max=len(i