Re: Python coding

2022-11-27 Thread Dennis Lee Bieber
On Sun, 27 Nov 2022 16:47:29 -0600, Karen Park declaimed the following: >I am trying to do a python code. Using Windows, I got as far as the step that >asks me to “copy the logistics.py file and save it in the same folder that you >are running python from” (as displayed by the command prompt).

RE: Python coding

2022-11-27 Thread Mike Dewhirst
Create a folder anywhere convenient and copy it in there.Then - if python has been downloaded from the Python website and installed "normally" you can open a command prompt in that folder and type C:\\$>python logistics.py"normally" means Python is in your path environment variable.--(Unsigned

Re: Python coding

2022-11-27 Thread Cameron Simpson
On 27Nov2022 16:47, Karen Park wrote: I am trying to do a python code. Using Windows, I got as far as the step that asks me to “copy the logistics.py file and save it in the same folder that you are running python from” (as displayed by the command prompt). Can you help direct me where to go t

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Michael Spencer wrote: > Claudio Grondi wrote: > >> ...I analysed the outcome of it and have >> come to the conclusion, that there were two major factors which >> contributed to squeezing of code: >> >>(1). usage of available variants for coding of the same thing >>(2). sqeezing the size

Re: python coding contest

2006-01-01 Thread Alex Martelli
Christian Tismer <[EMAIL PROTECTED]> wrote: > Hans Nowak wrote: > > >... for u in(3,14,10)) > > > > can be written as: > > > >... for u in 3,14,10) > > > > which would shave off a character. Tuples don't always need parentheses... > > This would work with a list comprehension. > Do

Re: python coding contest

2006-01-01 Thread Michael Spencer
Claudio Grondi wrote: > ...I analysed the outcome of it and have > come to the conclusion, that there were two major factors which > contributed to squeezing of code: > >(1). usage of available variants for coding of the same thing >(2). sqeezing the size of used numeric and string litera

Re: python coding contest

2006-01-01 Thread Jacob Hallen
In article <[EMAIL PROTECTED]>, Simon Hengel <[EMAIL PROTECTED]> wrote: >Hello, > >> After all, I'd really love to set up another contest with >> different measures and criteria. > >for future events i will take a close look at other possibilities for >doing a ranking. At the moment the 22c3 and t

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Claudio Grondi wrote: > Steven D'Aprano wrote: > >> On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: >> >> >> >>> What I have thought about as a simpler/better solution is a method >>> allowing to avoid processing the content of the string or long >>> integer object by looping over its

Re: python coding contest

2006-01-01 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > Steven D'Aprano wrote: > >>I'm reminded of a time I was going for a drive in the country when I drove >>past an apple orchid. Standing in the orchid was a farmer with a pig. He >>lifted the pig into the air, and the pig then bit an apple and slowly >>chewed it. The farme

Re: python coding contest

2006-01-01 Thread bonono
Steven D'Aprano wrote: > I'm reminded of a time I was going for a drive in the country when I drove > past an apple orchid. Standing in the orchid was a farmer with a pig. He > lifted the pig into the air, and the pig then bit an apple and slowly > chewed it. The farmer then carried him over to an

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Steven D'Aprano wrote: > On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: > > > >>What I have thought about as a simpler/better solution is a method >>allowing to avoid processing the content of the string or long integer >>object by looping over its content. > > > How can you avoi

Re: python coding contest

2006-01-01 Thread Steven D'Aprano
On Sun, 01 Jan 2006 15:49:58 +0100, Claudio Grondi wrote: > What I have thought about as a simpler/better solution is a method > allowing to avoid processing the content of the string or long integer > object by looping over its content. How can you avoid looping over its content? Whether you

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Steven D'Aprano wrote: > On Sun, 01 Jan 2006 03:34:33 +0100, Claudio Grondi wrote: > > >>>Please send me comments, suggestions and ideas. >> >>Now, after the contest is over I analysed the outcome of it and have >>come to the conclusion, that there were two major factors which >>contributed to

Re: python coding contest

2006-01-01 Thread Claudio Grondi
Claudio Grondi wrote: >> Please send me comments, suggestions and ideas. > > > Now, after the contest is over I analysed the outcome of it and have > come to the conclusion, that there were two major factors which > contributed to squeezing of code: > > (1). usage of available variants for c

Re: python coding contest

2005-12-31 Thread Steven D'Aprano
On Sun, 01 Jan 2006 03:34:33 +0100, Claudio Grondi wrote: >> Please send me comments, suggestions and ideas. > > Now, after the contest is over I analysed the outcome of it and have > come to the conclusion, that there were two major factors which > contributed to squeezing of code: > >(1)

Re: python coding contest

2005-12-31 Thread Claudio Grondi
> Please send me comments, suggestions and ideas. Now, after the contest is over I analysed the outcome of it and have come to the conclusion, that there were two major factors which contributed to squeezing of code: (1). usage of available variants for coding of the same thing (2). sqeez

Re: python coding contest

2005-12-31 Thread Christian Tismer
Hans Nowak wrote: >... for u in(3,14,10)) > > can be written as: > >... for u in 3,14,10) > > which would shave off a character. Tuples don't always need parentheses... This would work with a list comprehension. Doesn't work with a generator expression (thought of it, too, and the l

Re: python coding contest

2005-12-31 Thread Hans Nowak
André wrote: > Hans Nowak wrote: > >>André wrote: > > >>I don't know if this suggestion has been made already, but it seems to >>me that the end of the expression >> >> ... for u in(3,14,10)) >> >>can be written as: >> >> ... for u in 3,14,10) >> >>which would shave off a character. Tuple

Re: python coding contest

2005-12-31 Thread André
Hans Nowak wrote: > André wrote: > > I don't know if this suggestion has been made already, but it seems to > me that the end of the expression > >... for u in(3,14,10)) > > can be written as: > >... for u in 3,14,10) > > which would shave off a character. Tuples don't always need paren

Re: python coding contest

2005-12-31 Thread Hans Nowak
André wrote: > Christian Tismer wrote: >>It seems to be very hard to improve. No idea if this is >>possible: One might try to re-order the character string >>a bit to change moduli, trying to get one more number in >> >>(3,14,10) >> >>to be one-digit. Haven't tried, yet, and chances are small. >>

Re: python coding contest

2005-12-31 Thread André
Christian Tismer wrote: > André wrote: > > For the few that might be interested, I will be posting the details of > > a 117 character long solution to the challenge on my blog > > http://aroberge.blogspot.com/. > ... > It seems to be very hard to improve. No idea if this is > possible: One might t

Re: python coding contest

2005-12-31 Thread Christian Tismer
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. Congratulations! I'm very impressed by this elegant solution. It seems to be very hard to improve. No idea if this is p

Re: python coding contest

2005-12-31 Thread Christoph Zwerschke
Just wrote: > Duh, sorry, it's early. 118 is better than 119. Printable or not :) > Still, a 119 bytes version that is fully printable is pretty cool. No, you're right, I also somehow missed the point. I believed "»" to be "printable" (opposed to control char's) but technically speaking, the co

Re: python coding contest

2005-12-31 Thread Paddy
So, testosterone wins again! We get to boast: "Mine's smaller than your's" Lets wait for Pythonic to go to bed, then sneak downstairs, go to that tripple-X rated 'shortest solutions' website, and 'whack-off' some solutions. Unghhh, my solution... its coming!!! Well don't forget to clean up be

Re: python coding contest

2005-12-31 Thread Just
In article <[EMAIL PROTECTED]>, Just <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > > > Mark Dickinson wrote: > > > Here's a variant of André's brilliant idea that's > > > 119 characters long, and fully printable: > > > > > > j='

Re: python coding contest

2005-12-31 Thread Just
In article <[EMAIL PROTECTED]>, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Mark Dickinson wrote: > > Here's a variant of André's brilliant idea that's > > 119 characters long, and fully printable: > > > > j=''.join;seven_seg=lambda z:j(j(' _ | |_ _|_|' > > [ord('^r|=Zm.:v\r'[int(a)])%u*

Re: python coding contest

2005-12-30 Thread Christoph Zwerschke
Mark Dickinson wrote: > Here's a variant of André's brilliant idea that's > 119 characters long, and fully printable: > > j=''.join;seven_seg=lambda z:j(j(' _ | |_ _|_|' > [ord('^r|=Zm.:v\r'[int(a)])%u*2:][:3]for a in z) > +"\n"for u in(3,7,8)) You have an escaped CR (\r) as the last character

Re: python coding contest

2005-12-30 Thread Marius Gedminas
I managed it with vim. -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-30 Thread André
Claudio Grondi wrote: > > P.S. By the way: on Windows XP with UltraEdit there was no problem to > input the special characters. There is an ASCII table and a HEX editor > mode available for it. Any hints which free editor makes it possible, too? I simply used Pythonwin. (print chr(3), then cut an

Re: python coding contest

2005-12-30 Thread André
Shane Hathaway wrote: > Claudio Grondi wrote: > > so I tried all which made sense in the context of '0' conversion and > > found out, that it should be the > > > >' _ |_|_ _| |' > > > > not the at http://aroberge.blogspot.com/ > > > >' _ |_|_ _| |' > > The HTML source has the three spaces

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Claudio Grondi wrote: > so I tried all which made sense in the context of '0' conversion and > found out, that it should be the > >' _ |_|_ _| |' > > not the at http://aroberge.blogspot.com/ > >' _ |_|_ _| |' The HTML source has the three spaces. If the code had been surrounded by

Re: python coding contest

2005-12-30 Thread Claudio Grondi
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. > > Enjoy! > > André > It doesn't work for me as described on that page. The output is scrumbled. It seems, that the

Re: python coding contest

2005-12-30 Thread Tim Hochberg
Shane Hathaway wrote: > André wrote: > >>For the few that might be interested, I will be posting the details of >>a 117 character long solution to the challenge on my blog >>http://aroberge.blogspot.com/. >> >>Enjoy! > > > You took advantage of prime numbers, enabling you to extract encoded > i

Re: python coding contest

2005-12-30 Thread Shane Hathaway
André wrote: > For the few that might be interested, I will be posting the details of > a 117 character long solution to the challenge on my blog > http://aroberge.blogspot.com/. > > Enjoy! You took advantage of prime numbers, enabling you to extract encoded information using a single modulus op

Re: python coding contest

2005-12-30 Thread André
For the few that might be interested, I will be posting the details of a 117 character long solution to the challenge on my blog http://aroberge.blogspot.com/. Enjoy! André -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-30 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > Thomas Heller wrote: > >>X=' _ _ _ | _| _ |_|_' >>Y=0x23018F406A3530EC273F008 >>j="".join >>seven_seg=lambda n:j(j(c)+"\n"for c in zip(*[X[Y>>m+int(d)*9&7::8]for d in n >>for m in(6,3,0)])) > > > Interesting bit: > > Although there are more 3-char combinations

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Szabolcs Nagy wrote: > my two solutions (well I wasn't so clever to encode everything in > strings instead of numbers, but at least it won't give warnings about > non ascii characters): > 128: > j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b > in(4,2,1))+'\n'for i in(306775

Re: python coding contest

2005-12-30 Thread Szabolcs Nagy
my two solutions (well I wasn't so clever to encode everything in strings instead of numbers, but at least it won't give warnings about non ascii characters): 128: j,seven_seg=''.join,lambda s:j(j(' |_ |'[i>>3*int(c)&b]for c in s for b in(4,2,1))+'\n'for i in(306775170,1060861645,524130191)) 122:

Re: python coding contest

2005-12-30 Thread Shane Hathaway
Tim Hochberg wrote: > g=''.join;seven_seg=lambda i:g( > g(' _|x|'[ord("~$]m'k{d\x7fo"[int(n)])>>s&j] > for n in i for j in(2,1,4))+'\n'for s in(6,0,3)) > > I've replaced the unprintable characters and added some preemptive > linebreaks so that hopefully this won't get too munged. It's all clear

Re: python coding contest

2005-12-30 Thread Michael Spencer
Tim Hochberg wrote: > Shane Hathaway wrote: >> Andrew Durdin wrote: >> >>> On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >>> >>> I just found a 125 character solution. It's actually faster and more readable than the 133 character solution (though it's still obscure.) >>> >>> Hav

Re: python coding contest

2005-12-30 Thread Tim Hochberg
Shane Hathaway wrote: > Andrew Durdin wrote: > >>On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >> >> >>>I just found a 125 character solution. It's actually faster and more >>>readable than the 133 character solution (though it's still obscure.) >> >> >>Having spent a good deal of time a

Re: python coding contest

2005-12-30 Thread roberto . alsina
Thomas Heller wrote: > X=' _ _ _ | _| _ |_|_' > Y=0x23018F406A3530EC273F008 > j="".join > seven_seg=lambda n:j(j(c)+"\n"for c in zip(*[X[Y>>m+int(d)*9&7::8]for d in n > for m in(6,3,0)])) Interesting bit: Although there are more 3-char combinations when you read vertically, they compact be

Re: python coding contest

2005-12-30 Thread Thomas Heller
Shane Hathaway <[EMAIL PROTECTED]> writes: > Andrew Durdin wrote: >> On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: >> >>>I just found a 125 character solution. It's actually faster and more >>>readable than the 133 character solution (though it's still obscure.) >> Having spent a good de

Re: python coding contest

2005-12-29 Thread Shane Hathaway
Andrew Durdin wrote: > On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: > >>I just found a 125 character solution. It's actually faster and more >>readable than the 133 character solution (though it's still obscure.) > > > Having spent a good deal of time and effort, and not getting below

Re: python coding contest

2005-12-29 Thread Andrew Durdin
On 12/28/05, Shane Hathaway <[EMAIL PROTECTED]> wrote: > I just found a 125 character solution. It's actually faster and more > readable than the 133 character solution (though it's still obscure.) Having spent a good deal of time and effort, and not getting below 144 characters, I am now very ea

Re: python coding contest

2005-12-29 Thread Christian Tismer
Duncan Booth wrote: > Christian Tismer wrote: > >> And then help me to setup a different contest about content -- chris >> > Count me in. Great! Let's find a problem small enough to solve in reasonably time and large enough to exploit Python qualities. sincerely -- chris (below 130) -- Chr

Re: python coding contest

2005-12-29 Thread Simon Hengel
> It seems, that the site had some trouble to stay online and especially > to provide the ranking today. There was a problem with our server, sorry for that. Have fun, Simon Hengel -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-29 Thread Claudio Grondi
Simon Hengel wrote: > Hello, > we are hosting a python coding contest an we even managed to provide a > price for the winner... > > http://pycontest.net/ > > The contest is coincidentally held during the 22c3 and we will be > present there. > > https://events.ccc.de/congress/2005/wiki/Python_cod

Re: python coding contest

2005-12-29 Thread Marius Gedminas
I cannot reach the contest site at since all this morning. :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-29 Thread Marius Gedminas
I cannot not reach the contest site at since all this morning. :-( -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-29 Thread Simon Hengel
> A funny thing happened to me. > >The http://www.pycontest.net/ site was down for some minutes because : > >"A problem occurred in a Python script. " > > it seems, that > >'some clever cheat' > > has crashed it. That was me, i broke things while tweaking some stuff. Sorry for the

Re: python coding contest

2005-12-28 Thread Simon Hengel
Hello, > After all, I'd really love to set up another contest with > different measures and criteria. for future events i will take a close look at other possibilities for doing a ranking. At the moment the 22c3 and the contest is eating up all my time. Pleas appreciate that i may not keep up wit

Re: python coding contest

2005-12-28 Thread Simon Hengel
> the dream of winning the contest seems to be over. Sorry for that, I'm considering doing a ranking on the nicest cheats too. Have fun, Simon Hengel -- python coding contest - http://www.pycontest.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-28 Thread Claudio Grondi
Simon Hengel wrote: > Hello, > we are hosting a python coding contest an we even managed to provide a > price for the winner... > > http://pycontest.net/ > > The contest is coincidentally held during the 22c3 and we will be > present there. > > https://events.ccc.de/congress/2005/wiki/Python_cod

Re: python coding contest

2005-12-28 Thread Tim Peters
[Bengt Richter] > ... > [23:28] C:\pywk\clp\seven\pycontest_01>wc -lc seven_seg.py > 2136 seven_seg.py > > 2 lines, 136 chars including unix-style lineseps (is that cheating on > windows?) Na. Most native Windows apps (including native Windows Python) don't care whether \n or

Re: python coding contest

2005-12-28 Thread Tim Hochberg
Marius Gedminas wrote: > Jean-Paul Calderone wrote: > >>On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote: >> >>>Shane Hathaway wrote: >>> Paul McGuire wrote: Also, here's another cheat version. (No, 7seg.com does not exist.) import urllib2 >

Re: python coding contest

2005-12-28 Thread Marius Gedminas
Jean-Paul Calderone wrote: > On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote: > >Shane Hathaway wrote: > >> Paul McGuire wrote: > >> > >> > >> Also, here's another cheat version. (No, 7seg.com does not exist.) > >> > >>import urllib2 > >>def seven_seg(x):return u

Re: python coding contest

2005-12-28 Thread Tim Hochberg
Shane Hathaway wrote: > I just found a 125 character solution. It's actually faster and more > readable than the 133 character solution (though it's still obscure.) > > It depends on Python 2.4. If Python 2.3 compatibility is required for > the contest, I have to add 4 characters. I asked, 2.

Re: python coding contest

2005-12-28 Thread Shane Hathaway
I just found a 125 character solution. It's actually faster and more readable than the 133 character solution (though it's still obscure.) It depends on Python 2.4. If Python 2.3 compatibility is required for the contest, I have to add 4 characters. Shane [EMAIL PROTECTED] pycontest_01]$ wc

Re: python coding contest

2005-12-28 Thread Duncan Booth
Christian Tismer wrote: > And then help me to setup a different contest about content -- chris > Count me in. -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-28 Thread Roman Susi
Tim Hochberg wrote: > py pan wrote: > >>When you guys say 127~150 characters, did you guys mean >>usinging test_vectors.py in some way? Or there's no import at all? >> > > > No import at all. The shortest solution reported so far is 131 > characters. Getting down to 127 is just a guess as to wh

Re: python coding contest

2005-12-28 Thread Bengt Richter
On 27 Dec 2005 09:24:44 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >Scott David Daniels wrote: > >>> I definitively need a new algorythm. >>> >> And I am sadly stuck at 169. Not even spitting distance from 149 (which >> sounds like a non-cheat version). > >Throw it away and start again with a

Re: python coding contest

2005-12-27 Thread Remi Villatel
Christian Tismer wrote: >>> I feel that python is more beautiful and readable, even if you write >>> short programs. > Looking at what I produced the last days, I'm not convinced... Me neither. Especially since I've taken the one-liner road. Python can be very unreadable... sometimes. > And th

Re: python coding contest

2005-12-27 Thread py pan
On 12/27/05, Christian Tismer <[EMAIL PROTECTED]> wrote: And we are of course implementing algorithms with a twisted goal-setin mind: How to express this the shortest way, not elegantly,just how to shave off one or even two bytes, re-iterating thepossible algorithms again and again, just to find a

Re: python coding contest

2005-12-27 Thread Tim Hochberg
Christian Tismer wrote: [SNIP] > And then help me to setup a different contest about content -- chris As usual, I expect that actually having some working code measuring 'Pythonic' length (and I'm sure we could get into all sorts of fun arguments about the exact definition of that) would go a l

Re: python coding contest

2005-12-27 Thread Christian Tismer
Remi Villatel wrote: > Scott David Daniels wrote: > > [--CUT---] >>> 39 bytes... 53 bytes... It gives me the impression to follow a jet >>> plane with a bike with my 179 bytes! > [--CUT--] > >> And I am sadly stuck at 169. Not even spitting distance from 149 (which >> sounds like a

Re: python coding contest

2005-12-27 Thread Remi Villatel
Scott David Daniels wrote: [--CUT---] >> 39 bytes... 53 bytes... It gives me the impression to follow a jet >> plane with a bike with my 179 bytes! [--CUT--] > And I am sadly stuck at 169. Not even spitting distance from 149 (which > sounds like a non-cheat version). Try harder

Re: python coding contest

2005-12-27 Thread Christian Tismer
James Tanis wrote: > On 12/25/05, Simon Hengel <[EMAIL PROTECTED]> wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >>> I'm envisioning lots of convoluted one-liners which >>> are more suitable to a different P-language... :-) >> I feel that python is more beautiful and readable, even

Re: python coding contest

2005-12-27 Thread Tim Hochberg
Jean-Paul Calderone wrote: > On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote: > >>Shane Hathaway wrote: >> >>>Paul McGuire wrote: >>> >>> >>>Also, here's another cheat version. (No, 7seg.com does not exist.) >>> >>> import urllib2 >>> def seven_seg(x):return urllib2

Re: python coding contest

2005-12-27 Thread Justin Azoff
Tim Hochberg wrote: > Note that in principle it's possible to encode the data for how to > display a digit in one byte. Thus it's at least theoretically possible > to condense all of the information about the string into a string that's > 10 bytes long. In practice it turns out to be hard to do tha

Re: python coding contest

2005-12-27 Thread Claudio Grondi
[EMAIL PROTECTED] wrote: > I now have a version which passes the test suite in 32 bytes grin> > > -T. > After I have posted the statement, that I have one with 39 bytes, I had the 32 version five minutes later, but thougt that instead of posting it I can maybe use it as entry on the contest ..

Re: python coding contest

2005-12-27 Thread Jean-Paul Calderone
On Tue, 27 Dec 2005 14:02:57 -0700, Tim Hochberg <[EMAIL PROTECTED]> wrote: >Shane Hathaway wrote: >> Paul McGuire wrote: >> >> >> Also, here's another cheat version. (No, 7seg.com does not exist.) >> >>import urllib2 >>def seven_seg(x):return urllib2.urlopen('http://7seg.com/'+x).read() >

Re: python coding contest

2005-12-27 Thread Duncan Booth
Tim Hochberg wrote: > py pan wrote: >> When you guys say 127~150 characters, did you guys mean >> usinging test_vectors.py in some way? Or there's no import at all? >> > > No import at all. The shortest solution reported so far is 131 > characters. Getting down to 127 is just a guess as to wher

Re: python coding contest

2005-12-27 Thread Tim Hochberg
Shane Hathaway wrote: > Paul McGuire wrote: > >>"Paul McGuire" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >> >>>Well *I'm* certainly looking forward to learning some new tricks! My >>>(non-cheat) version is a comparatively-portly 245, and no alternatives are >>>popping into

Re: python coding contest

2005-12-27 Thread Tim Hochberg
py pan wrote: > When you guys say 127~150 characters, did you guys mean > usinging test_vectors.py in some way? Or there's no import at all? > No import at all. The shortest solution reported so far is 131 characters. Getting down to 127 is just a guess as to where the lower bound is likely to

Re: python coding contest

2005-12-27 Thread James Tanis
On 12/25/05, Simon Hengel <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I'm envisioning lots of convoluted one-liners which > > are more suitable to a different P-language... :-) > I feel that python is more beautiful and readable, even if you write > short prog

Re: python coding contest

2005-12-27 Thread py pan
When you guys say 127~150 characters, did you guys mean usinging test_vectors.py in some way? Or there's no import at all? -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-27 Thread Guyon Morée
So, is an ugly short one a candidate? i managed in 199 bytes :) i'll send it in anyway ciao http://gumuz.looze.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-27 Thread Tim Hochberg
Shane Hathaway wrote: > Tim Hochberg wrote: > >>Paul McGuire wrote: >> >> >>>"Shane Hathaway" <[EMAIL PROTECTED]> wrote in message >>>news:[EMAIL PROTECTED] >>> >>> >>> I'm down to 133 characters (counted according to 'wc -c') on a single line. It contains about 11 whitespace characters (

Re: python coding contest

2005-12-27 Thread Duncan Booth
Tim Hochberg wrote: > This is interesting. I have a six line solution that is 133 characters > long. I use no long integers, which is what's interesting; two > distinct solutions with the same length. I played with long integers > for a bit, and I can see how one could use a single long integer, bu

Re: python coding contest

2005-12-27 Thread Shane Hathaway
Tim Hochberg wrote: > Paul McGuire wrote: > >>"Shane Hathaway" <[EMAIL PROTECTED]> wrote in message >>news:[EMAIL PROTECTED] >> >> >>>I'm down to 133 characters (counted according to 'wc -c') on a single >>>line. It contains about 11 whitespace characters (depending on what you >>>consider whites

Re: python coding contest

2005-12-27 Thread Tim Hochberg
Paul McGuire wrote: > "Shane Hathaway" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I'm down to 133 characters (counted according to 'wc -c') on a single >>line. It contains about 11 whitespace characters (depending on what you >>consider whitespace.) It's way too tricky for

Re: python coding contest

2005-12-27 Thread ZeD
Ciao, Shane Hathaway! Che stavi dicendo? > I'm down to 133 characters (counted according to 'wc -c') on a single > line. It contains about 11 whitespace characters (depending on what you > consider whitespace.) $ wc -c seven_seg.py 137 seven_seg.py $ sed 's/ //g' seven_seg.py|wc -c 120 (yeah, to

Re: python coding contest

2005-12-27 Thread taroso
I now have a version which passes the test suite in 32 bytes -T. -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-27 Thread Paul McGuire
"Shane Hathaway" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > I'm down to 133 characters (counted according to 'wc -c') on a single > line. It contains about 11 whitespace characters (depending on what you > consider whitespace.) It's way too tricky for my taste, but it's fun t

Re: python coding contest

2005-12-27 Thread Shane Hathaway
Paul McGuire wrote: > "Paul McGuire" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > >>Well *I'm* certainly looking forward to learning some new tricks! My >>(non-cheat) version is a comparatively-portly 245, and no alternatives are >>popping into my head at the moment! >> >>--

Re: python coding contest

2005-12-27 Thread Duncan Booth
Scott David Daniels wrote: >> I definitively need a new algorythm. >> > And I am sadly stuck at 169. Not even spitting distance from 149 (which > sounds like a non-cheat version). Throw it away and start again with a fresh (clean) solution. That's what I did when I'd reached the limit of nest

Re: python coding contest

2005-12-27 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Well *I'm* certainly looking forward to learning some new tricks! My > (non-cheat) version is a comparatively-portly 245, and no alternatives are > popping into my head at the moment! > > -- Paul > > down to 2 lines, 229

Re: python coding contest

2005-12-27 Thread Paul McGuire
"Scott David Daniels" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Remi Villatel wrote: > > Tim Hochberg wrote: > > > >>> I am currently at 39 bytes following the requirements and the > >>> principle given above (my module passes the test). Anyone able to > >>> beat that? > > > >>

Re: python coding contest

2005-12-26 Thread Scott David Daniels
Remi Villatel wrote: > Tim Hochberg wrote: > >>> I am currently at 39 bytes following the requirements and the >>> principle given above (my module passes the test). Anyone able to >>> beat that? > >> Wow! It'll be interesting to see how to do that. The obvious way gives >> 53 bytes. Hmmm, I'l

Re: python coding contest

2005-12-26 Thread Christian Tismer
Remi Villatel wrote: > 39 bytes... 53 bytes... It gives me the impression to follow a jet plane > with a bike with my 179 bytes! > > There isn't a single superfluous byte. My code is so compressed that the > syntactic colorizer can't cope any more. > > I definitively need a new algorythm. Yo

Re: python coding contest

2005-12-26 Thread Remi Villatel
Tim Hochberg wrote: >> I am currently at 39 bytes following the requirements and the >> principle given above (my module passes the test). Anyone able to beat >> that? > Wow! It'll be interesting to see how to do that. The obvious way gives > 53 bytes. Hmmm, I'll have to see what can be done..

Re: python coding contest

2005-12-26 Thread Justin Azoff
Tim Hochberg wrote: > In the 130's is definately possible, but I haven't heard of anyone doing > better than that. I have a version that is 127, but only if you strip extra whitespace :-( -- - Justin -- http://mail.python.org/mailman/listinfo/python-list

Re: python coding contest

2005-12-26 Thread Tim Hochberg
Tim Hochberg wrote: [CHOP] > > import test;seven_seg=test.test_vectors.get > > This works if you run test. It fails if you try to run it standalone > since the import order is wrong. [CHOP] Or maybe not. An earlier version did, but this one seems OK. -tim -- http://mail.python.org/mailman/li

Re: python coding contest

2005-12-26 Thread Christian Tismer
Tim Hochberg wrote: > import test;seven_seg=test.test_vectors.get Oupps, good (being blinded after all the other from imports and __import__(...) ) -- Christian Tismer :^) tismerysoft GmbH : Have a break! Take a ride on

Re: python coding contest

2005-12-26 Thread Tim Hochberg
Steven D'Aprano wrote: > On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: > > >>Claudio Grondi wrote: > > >>>I am currently at 39 bytes following the requirements and the principle >>>given above (my module passes the test). Anyone able to beat that? >> >>Wow! It'll be interesting to se

Re: python coding contest

2005-12-26 Thread Christian Tismer
Steven D'Aprano wrote: > On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: > >> Claudio Grondi wrote: > >>> I am currently at 39 bytes following the requirements and the principle >>> given above (my module passes the test). Anyone able to beat that? >> Wow! It'll be interesting to see how

Re: python coding contest

2005-12-26 Thread Steven D'Aprano
On Mon, 26 Dec 2005 13:33:42 -0700, Tim Hochberg wrote: > Claudio Grondi wrote: >> I am currently at 39 bytes following the requirements and the principle >> given above (my module passes the test). Anyone able to beat that? > > Wow! It'll be interesting to see how to do that. The obvious way g

Re: python coding contest

2005-12-26 Thread Malte Dik
Tim Hochberg wrote: > Claudio Grondi wrote: >> Peter Otten wrote: > [SNIP] >>>How good is "good" for >>> >>>import test_vectors >>>seven_seg = test_vectors.test_vectors.get >>> >>>or code using the test suite in general? >>> >>>Peter >>> >> >> This started to remind myself about the story of the

Re: python coding contest

2005-12-26 Thread Duncan Booth
Tim Hochberg wrote: > [EMAIL PROTECTED] wrote: >> Currently I'm on 149 characters in one line - 128 without >> spaces/newlines. (it'd be three characters shorter if it didn't have >> to end with a "\n") > > > It'll be interesting to see what the short 1-line answers look like. I > have a hard

  1   2   >