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
t variable.--(Unsigned mail from my phone) Original message From: Karen Park Date: 28/11/22 10:07 (GMT+10:00) To: python-list@python.org Subject: Python coding Hello,I am trying to do a python code. Using Windows, I got as far as the step that asks me to “copy the logistics

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

Python coding

2022-11-27 Thread Karen Park
Hello, 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 to copy and save this “logistics.

HI Need help for python coding

2013-04-09 Thread kamalakar gs
Hi, Actually I have PCL file (i..e patran file).I want python coding to be done so that it will read the PCL file and open Patran GUI window.How to do that.Kindly find the attached PCL file for your ref. Thanks regards Kamalakar shell.pcl Description: Binary data -- http://mail.python.org

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 6:24 PM Bubba said... Your code only shows the first 488 bytes of the file? add 'rb' to the open statement... >>> pdflines = open(r'c:\shared\python_book_01.pdf','rb').readlines() >>> sps = [0] >>> for ii in pdflines: sps.append(sps[-1]+len(ii)) Emile -- http://mail.python.

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 5:55 PM Bubba said... Does this work for binary files? (Like PDFs) I don't know what you want -- pdf's are not line oriented so searching for \n's is sketchy from the get go. I figured this was homework to test something Emile -- http://mail.python.org/mailman/listinfo/py

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Your code only shows the first 488 bytes of the file? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a Python coding question

2011-01-05 Thread Bubba
Does this work for binary files? (Like PDFs) -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- - -- - -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with a Python coding question

2011-01-05 Thread Justin Peel
On Wed, Jan 5, 2011 at 4:45 PM, Emile van Sebille wrote: > On 1/5/2011 3:12 PM kanth...@woh.rr.com said... > > I want to use Python to find all "\n" terminated >> strings in a PDF file, ideally returning string >> starting addresses. Anyone willing to help? >> > > pdflines = open(r'c:\shared\p

Re: Help with a Python coding question

2011-01-05 Thread Emile van Sebille
On 1/5/2011 3:12 PM kanth...@woh.rr.com said... I want to use Python to find all "\n" terminated strings in a PDF file, ideally returning string starting addresses. Anyone willing to help? pdflines = open(r'c:\shared\python_book_01.pdf').readlines() sps = [0] for ii in pdflines: sps.append(sp

Help with a Python coding question

2011-01-05 Thread kanthony
I want to use Python to find all "\n" terminated strings in a PDF file, ideally returning string starting addresses. Anyone willing to help? -- - --- -- - Posted with NewsLeecher v4.0 Final Web @ http://www.newsleecher.com/?usenet --- -

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread John Machin
Sebastian 'lunar' Wiesner wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ zxo102 <[EMAIL PROTECTED]> ] how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to "\xED\x6F\x3C\x01" in python coding? When I take 'ED6F3C01&#

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread John Machin
zxo102 wrote: Hi, how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to "\xED\x6F\x3C\x01" in python coding? If by "in python coding" you mean "in Python source code", then just type it in with \x in front of each pair of hex dig

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread J. Clifford Dyer
x27;, '0x1'] Cheers, Cliff > On 5月25日, 上午6时46分, Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> > wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > [ zxo102 <[EMAIL PROTECTED]> ] > > > > >how to change the

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread J. Clifford Dyer
On Sat, 2008-05-24 at 15:36 -0700, zxo102 wrote: > Hi, >how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to > "\xED\x6F\x3C\x01" in python coding? > When I take 'ED6F3C01' as a string and insert '\x' into it, I jus

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread zxo102
5月25日, 上午6时46分, Sebastian 'lunar' Wiesner <[EMAIL PROTECTED]> > wrote: > > > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > [ zxo102 <[EMAIL PROTECTED]> ] > > > >how to change the hexadecimal 'ED6F3C01' (or

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread zxo102
PGP SIGNED MESSAGE- > Hash: SHA1 > > [ zxo102 <[EMAIL PROTECTED]> ] > > >how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to > > "\xED\x6F\x3C\x01" in python coding? > > When I take 'ED6F3C01' as a string

Re: Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread Sebastian 'lunar' Wiesner
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 [ zxo102 <[EMAIL PROTECTED]> ] >how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to > "\xED\x6F\x3C\x01" in python coding? > When I take 'ED6F3C01' as a string and insert '

Hexadecimal: how to convert 'ED6F3C01' to "\xED\x6F\x3C\x01" in python coding?

2008-05-24 Thread zxo102
Hi, how to change the hexadecimal 'ED6F3C01' (or 'ED 6F 3C 01') to "\xED\x6F\x3C\x01" in python coding? When I take 'ED6F3C01' as a string and insert '\x' into it, I just got the error information : invalid \x escape. Thanks. ouyang -- http://mail.python.org/mailman/listinfo/python-list

Re: assistance with python coding

2006-09-11 Thread John Purser
On Mon, 2006-09-11 at 11:23 -0500, John Shappell wrote: > I don’t understand what this question is asking; can you clarify for > me and maybe point me in the right direction? > > > > As an exercise, rewrite this line of code without using a sequence > assignment. > > self.cards[i], self.cards

RE: assistance with python coding

2006-09-11 Thread Richard Morello
: python-list@python.orgSubject: assistance with python coding I don’t understand what this question is asking; can you clarify for me and maybe point me in the right direction?   As an exercise, rewrite this line of code without using a sequence assignment. self.cards[i

assistance with python coding

2006-09-11 Thread John Shappell
I don’t understand what this question is asking; can you clarify for me and maybe point me in the right direction?   As an exercise, rewrite this line of code without using a sequence assignment. self.cards[i], self.cards[j] = self.cards[j], self.cards[i]   V/R   CW2 John Shappell

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

python coding contest

2005-12-30 Thread Mark Dickinson
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)) Mark -- http://mail.python.org/mailman/listinfo/python-list

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://ev

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
i broke things while tweaking some stuff. Sorry for the inconveniences, 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 Simon Hengel
not keep up with all mails. Sorry for that. Cheers, -- python coding contest - http://www.pycontest.net/ -- http://mail.python.org/mailman/listinfo/python-list

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://ev

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 (

  1   2   >