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: SyntaxError: invalid syntax

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 07:40:12 +, DIBS wrote: > I'm new to Python and I don't understand what I'm doing wrong. > > I'm running windows xp. > > In the command line window, I type: > Python Sudoku.py > > and I get the response" > > SyntaxError: invalid syntax > > If anyone cane help me I'd be

Re: build curiosities of svn head (on WinXP)

2005-12-27 Thread Fredrik Lundh
David Murmann wrote: > so this is where the problem has to be, but i am still not sure what to do > about this. is this a problem with my configuration, with my build or > with python? it's a python bug, and it has been introduced relatively recently. iirc, there has been some recent tweaks to t

Re: help with lists and writing to file in correct order

2005-12-27 Thread Steven D'Aprano
On Mon, 26 Dec 2005 20:56:17 -0800, homepricemaps wrote: > sorry for asking such beginner questions but i tried this and nothing > wrote to my text file > > for food, price, store in bs(food, price, store): > out = open("test.txt", 'a') > out.write (food + price + stor

Re: MySQLdb Python API: Unable to connect

2005-12-27 Thread Nicolas Kassis
Dennis Lee Bieber wrote: >On 26 Dec 2005 21:39:11 -0800, "Mondal" <[EMAIL PROTECTED]> declaimed >the following in comp.lang.python: > > > >c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=330­6) > > > > So what is that - doing in the port number

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: SyntaxError: invalid syntax

2005-12-27 Thread Fredrik Lundh
Steven D'Aprano wrote: > Please post the *full* traceback of the error, not just the last > description. > > For example, something like this: > > >>> x = x+*9 > File "", line 1 > x = x+*9 > ^ > SyntaxError: invalid syntax > > Just "SyntaxError" on its own is not enough to tell wha

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Harald Armin Massa
Guido at Google: a message in THE public forum c.l.p. A confirmation by Martellibot, that Guido is IN FACT sitting 15m distant from him; and everybody in Python knows where Martellibot has his desk. Can it get more official than this? yeah: a confirmation by Greg Stein @ Google within slashdot,

Re: PIL and ImageMagick scalability

2005-12-27 Thread Fredrik Lundh
Sebastjan Trepca wrote: > I have a question about image processing. We have a website which will > process a lot of images a day.It will be running Apache(worker) with > mod_python. My question is what should we use for processing. If we > use PIL the processing will be done with the same process

Re: XPath-like filtering for ElementTree

2005-12-27 Thread Fredrik Lundh
Gerard Flanagan wrote: > Pseudo-XPath support for ElementTree with the emphasis on 'Pseudo'. > > http://gflanagan.net/site/python/pagliacci/ElementFilter.html > > It's an approach suggested by the Specification Pattern > > eg. http://www.martinfowler.com/apsupp/spec.pdf > > Not tested beyo

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 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: SyntaxError: invalid syntax

2005-12-27 Thread DIBS
>>> python sudoku.py File "", line 1 python sudoku.py ^ >>>SyntaxError: invalid syntax Thanks for your help. The above is the extact message. DIBS "Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Tue, 27 Dec 2005 07:40:12 +

Re: [EVALUATION] - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Martin P. Hellwig
Ilias Lazaridis wrote: So I guess you volunteer http://www.python.org/psf/volunteer.html ? -- mph -- 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: SyntaxError: invalid syntax

2005-12-27 Thread Fredrik Lundh
"DIBS" <[EMAIL PROTECTED]> wrote: > >>> python sudoku.py > File "", line 1 >python sudoku.py > ^ > > >>>SyntaxError: invalid syntax > Thanks for your help. > The above is the extact message. that looks like the Python interpreter window, not the Windows command- l

how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Chris Song
Here's my solution _unicodeRe = re.compile("(\\\u[\da-f]{4})") def unisub(mo): return unichr(int(mo.group(1)[2:],16)) unicodeStrFromNetwork = '\u5927' unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) But I think there must be a more straightforward way to do it. -- http://m

how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Chris Song
Here's my solution _unicodeRe = re.compile("(\\\u[\da-f]{4})") def unisub(mo): return unichr(int(mo.group(1)[2:],16)) unicodeStrFromNetwork = '\u5927' unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) But I think there must be a more straightforward way to do it. -- http://m

oop in python

2005-12-27 Thread novice
hello over there! I have the following question: Suppose I created a class: class Point: pass then instanciated an instance: new = Point() So now how to get the instance new as a string: like ' new ' ; Is there any built in

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: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Leif K-Brooks
Chris Song wrote: > Here's my solution > > _unicodeRe = re.compile("(\\\u[\da-f]{4})") > def unisub(mo): > return unichr(int(mo.group(1)[2:],16)) > > unicodeStrFromNetwork = '\u5927' > unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) > > But I think there must be a more straigh

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Ganesan Rajagopal
> "Chris" == Chris Song <[EMAIL PROTECTED]> writes: > Here's my solution > _unicodeRe = re.compile("(\\\u[\da-f]{4})") > def unisub(mo): > return unichr(int(mo.group(1)[2:],16)) > unicodeStrFromNetwork = '\u5927' > unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) How about

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Fredrik Lundh
Ganesan Rajagopal wrote: >> unicodeStrFromNetwork = '\u5927' >> unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) > > How about unicodeStrNative = eval("u'%s'" % (unicodeStrFromNetwork,)) unicodeStrFromNetwork = "' + str(__import__('os').system('really bad idea')) + '" -- http:

Re: Windows and python execution

2005-12-27 Thread Peter Hansen
BartlebyScrivener wrote: >>>What you need to do is include the following line in autoexec.bat: >>>set .py=c:\python24\python.exe > > > Whatever works for you. I don't have that command in my autoexec.bat > file and my python scripts execute from any location because the > directory they are store

Re: Windows and python execution

2005-12-27 Thread Peter Hansen
Peter Hansen wrote: > BartlebyScrivener wrote: What you need to do is include the following line in autoexec.bat: set .py=c:\python24\python.exe >> >>Whatever works for you. I don't have that command in my autoexec.bat >>file and my python scripts execute from any location because the >>dir

Re: PyHtmlGUI Project is looking for developers

2005-12-27 Thread phoenixathell
Because embedding KHTML means that you have a GUI application that runs on a special operation system. But what we propose is that you can write a web application in the same way like your GUI application and it appears like a "normal" GUI. Web application means in these case that you have a appli

Re: how to convert string like '\u5927' to unicode string u'\u5927'

2005-12-27 Thread Ganesan Rajagopal
> "Fredrik" == Fredrik Lundh <[EMAIL PROTECTED]> writes: > Ganesan Rajagopal wrote: >>> unicodeStrFromNetwork = '\u5927' >>> unicodeStrNative = _unicodeRe(unisub, unicodeStrFromNetwork) >> >> How about unicodeStrNative = eval("u'%s'" % (unicodeStrFromNetwork,)) > unicodeStrFromNetwork = "' +

Re: Windows and python execution

2005-12-27 Thread Daniel Dittmar
Tim Roberts wrote: > Mark Carter <[EMAIL PROTECTED]> wrote: >>What you need to do is include the following line in autoexec.bat: >>set .py=c:\python24\python.exe >> >>This will achieve the desired result. I'm suprised more people don't use it. > > > They don't use it, because it doesn't do anythi

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: oop in python

2005-12-27 Thread Uwe Hoffmann
novice schrieb: > class Point: >def _func_that_we_want_(self): > return ... return self.__class__.__name__ http://docs.python.org/ref/types.html#l2h-109 -- http://mail.python.org/mailman/listinfo/python-list

I want to exclude an expression of a sequence of charecters with regex

2005-12-27 Thread 28tommy
Hello all, I know how to exclude 1 charecter from a compiled sequence of the re module- '[^a]', but if I want to exclude a word or a sequence as one unit (not as separate charecters) to be checked how do I do that? I tried re.compile('[^(abc)]') ... or re.compile('[^a][^b][^c]') ... or re.com

Patch : doct.merge

2005-12-27 Thread Nicolas Lehuen
Hi, I've posted this patch on Source forge : http://sourceforge.net/tracker/index.php?func=detail&aid=1391204&group_id=5470&atid=305470 If you want to update a dictionary with another one, you can simply use update : a = dict(a=1,c=3) b = dict(a=0,b=2) a.update(b) assert a == dict(a=0,b=2,c=3)

libxml2dom problems

2005-12-27 Thread ankit
I am using libxml2dom but having problem when parsing. It gives me the following error: File "exlibxml2dom.py", line 4, in ? document = libxml2dom.parse("moc.xml") File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line 472, in parse return parseFile(stream_or_string, html)

Re: libxml2dom problems

2005-12-27 Thread Fredrik Lundh
"ankit" <[EMAIL PROTECTED]> wrote: >I am using libxml2dom but having problem when parsing. It gives me the > following error: > > File "exlibxml2dom.py", line 4, in ? >document = libxml2dom.parse("moc.xml") > File "/usr/lib/python2.2/site-packages/libxml2dom/__init__.py", line > 472, in parse

Re: PyHtmlGUI Project is looking for developers

2005-12-27 Thread Marco Aschwanden
A good idea... but I would prefer it being abstracted from Zope... -- http://mail.python.org/mailman/listinfo/python-list

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: [EVALUATION] - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Michael
Ilias Lazaridis wrote: > [ panic, fear, worry ] What's wrong with just saying "Congratulations!" ? First thing I thought was "ooh, maybe Guido will be able to work on P3K there" - after all that would benefit Google *and* everyone else :-) (Especially if he uses PyPy to experiment and play in ...

Re: PyHtmlGUI Project is looking for developers

2005-12-27 Thread phoenixathell
Hi Sybren, the idea of pyhtmlgui is that you can develop a web application the same way like a standard gui application. So what you get is a widget tree (buttons, forms, title bars, etc.) on the server side and a gui on the client side. The server in our case would be something like Apache or Zop

Re: Which Python web framework is most like Ruby on Rails?

2005-12-27 Thread Pierre Quentel
Yes, there is a clear winner : "python zope" = 3.950.000 Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: I want to exclude an expression of a sequence of charecters with regex

2005-12-27 Thread Fredrik Lundh
"28tommy" wrote: > I know how to exclude 1 charecter from a compiled sequence of the re > module- '[^a]', but if I want to exclude a word or a sequence as one > unit (not as separate charecters) to be checked how do I do that? > > I tried re.compile('[^(abc)]') > ... or re.compile('[^a][^b][^c

Re: oop in python

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 02:42:18 -0800, novice wrote: > > hello over there! > I have the following question: > Suppose I created a class: class Point: > pass > then instanciated an instance: new = Point() > So now how to get the

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

Qtdesigner and python

2005-12-27 Thread Siraj Kutlusan
I heard that you can use .ui files with python or something of the likes. Could anyone help me with telling me how to do this? -- http://mail.python.org/mailman/listinfo/python-list

Re: help with lists and writing to file in correct order

2005-12-27 Thread Siraj Kutlusan
Why don't you use pickle instead of directly writing to the file yourself? -- http://mail.python.org/mailman/listinfo/python-list

Re: closing stdin, stdout and stderr

2005-12-27 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Martijn Brouwer <[EMAIL PROTECTED]> wrote: ... > I read this one, which was the reason that I tried os.close instead of > sys.stdXXX.close(). But I would like to know why it does not close a > file discriptor is I call its close method(). They're special. I suppos

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: Qtdesigner and python

2005-12-27 Thread Phil Thompson
On Tuesday 27 December 2005 5:10 pm, Siraj Kutlusan wrote: > I heard that you can use .ui files with python or something of the likes. > Could anyone help me with telling me how to do this? You can either convert the .ui file to Python code using pyuic or you can load the .ui file directly using

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: Beautiful Python

2005-12-27 Thread Gekitsuu
That is part of what I was asking but I was also hoping to hear the common wisdom so to speak. When I posted I had considered the idea for a bit and the situations people have mentioned were similar to the scenario I came up with as a good time to break such a rule. My hypothetical situation was as

Re: SyntaxError: invalid syntax

2005-12-27 Thread Terry Hancock
On Tue, 27 Dec 2005 09:32:18 GMT "DIBS" <[EMAIL PROTECTED]> wrote: > >>> python sudoku.py > File "", line 1 >python sudoku.py > ^ > > >>>SyntaxError: invalid syntax > > Thanks for your help. > The above is the extact message. Based on the ">>>" prompt, I'd say you

Re: MySQLdb Python API: Unable to connect

2005-12-27 Thread Fredrik Lundh
Dennis Lee Bieber wrote: > > I don't see anything with 324 in there ? What do you mean ? > > > A direct copy from about ten lines above. > > > >c=MySQLdb.Connect(host='localhost',user='root',passwd='',db='shop',port=330­6) > > 330 minus 6 equals 324 except that the - you're seeing is a soft h

Re: Beautiful Python

2005-12-27 Thread Fredrik Lundh
"Gekitsuu" wrote: > That is part of what I was asking but I was also hoping to hear the > common wisdom so to speak. When I posted I had considered the idea for > a bit and the situations people have mentioned were similar to the > scenario I came up with as a good time to break such a rule. My >

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 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 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: Beautiful Python

2005-12-27 Thread Peter Decker
On 27 Dec 2005 10:02:17 -0800, Gekitsuu <[EMAIL PROTECTED]> wrote: > My > hypothetical situation was as follows. I'm writing a new generic SQL > module and I want to make it so I only call the appropriate module for > the type of SQL server I'm talking to. Then it would make sense to > load, for in

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

how to modify the csv file

2005-12-27 Thread muttu2244
hi everybody am trying to modify a particular string from a csv file. for ex say i have compName, ipAddr, MacAddr,Os sdfsdf ,129.122.12.34 , dsfiasdf, wsfdjhs hsdfdf , 123.234.34.34, dsfiasdfds, wewr etc now if i got to modify one particular line from these three rows ,

Re: how to modify the csv file

2005-12-27 Thread skip
yogi> now if i got to modify one particular line from these three rows, yogi> how can i do that. Check out the csv module. Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: PHP = Perl Improved

2005-12-27 Thread Xah Lee
«use bytes; # Larry can take Unicode and shove it up his ass sideways. # Perl 5.8.0 causes us to start getting incomprehensible # errors about UTF-8 all over the place without this.» From: the source code of WebCollage (1998) http://www.jwz.org/webcollage/ by Jamie W. Zawi

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: Qtdesigner and python

2005-12-27 Thread [EMAIL PROTECTED]
u can use`pyuic` for this .. -- http://mail.python.org/mailman/listinfo/python-list

Re: PyHtmlGUI Project is looking for developers

2005-12-27 Thread phoenixathell
Hi Marco, that is one of our goals. But so far we didn't had the time to do it. PyHtmlGUI is already complete independent from Zope but it still needs some kind of request handling (another small script). One of our next steps will be to create a abstraction of the request handling to be independ

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 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: Microsoft's JavaScript doc's newfangled problem

2005-12-27 Thread Xah Lee
> What did you expect? There are two interpretations to this Microsoft's JavaScript doc problem: 1. They didn't do it intentionally. 2. They did it intentionally. If (1), then it would be a fucking incompetence of inordinate order. If (2), they would be assholes, even though they have the right

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: PyHtmlGUI Project is looking for developers

2005-12-27 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: > the idea of pyhtmlgui is that you can develop a web application the > same way like a standard gui application. So what you get is a > widget tree (buttons, forms, title bars, etc.) on the server side > and a gui on the client side. Ah, okay - it's the othe

Re: how to modify the csv file

2005-12-27 Thread muttu2244
hi skip i really tried with csv module, but i dint get anything, could u plase tell me the method to modify a particular row, or atleast let me know how can i delete a row in a csv file. thanks yogi -- http://mail.python.org/mailman/listinfo/python-list

html resize pics

2005-12-27 Thread rbt
What's a good way to resize pictures so that they work well on html pages? I have large jpg files. I want the original images to remain as they are, just resize the displayed image in the browser. -- http://mail.python.org/mailman/listinfo/python-list

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: how to modify the csv file

2005-12-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > i really tried with csv module, but i dint get anything, http://www.catb.org/~esr/faqs/smart-questions.html#beprecise > could u plase tell me the method to modify a particular row, or > atleast let me know how can i delete a row in a csv file. the same way as you'd mo

csv file how to modify the row

2005-12-27 Thread muttu2244
Hi everybody Am trying to read a csv file "temp.csv", which has the below info, compName macAddripAddr opSys Chris-Dev 0003469F44CC 10.160.24.226 Microsoft Windows XP Professional Shivayogi-Dev 000D5234F44C 10.160.24.136 Microsoft Windows XP Pro

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: Microsoft's JavaScript doc's newfangled problem

2005-12-27 Thread dimitri pater
On the other hand, in terms of documentation quality, technologicalexcellence, responsibility in software, Microsoft in the 21st century is the holder of human progress when compared to the motherfucking OpenSourcers lying thru their teeth fuckheads. XahThis is not amusing anymore, somebody please

Re: [EVALUATION] - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Ilias Lazaridis
Michael wrote: > Ilias Lazaridis wrote: > >>[ panic, fear, worry ] > > What's wrong with just saying "Congratulations!" ? nothing. But enouth people do this. I am focusing on weaknesses & threats: http://lazaridis.com/efficiency/graph/analysis.html > First thing I thought was > "ooh, maybe

Dr. Dobb's Python-URL! - weekly Python news and links (Dec 27)

2005-12-27 Thread Cameron Laird
QOTW: "My wild-ass guess is that, same as most other Open Source communities, we average about one asshole per member." - Tim Peters http://groups.google.com/group/comp.lang.python/msg/02236cc5ab54fd90?hl=en "[T]he only fundamentally new concept that has been added since Python 1.5.2 is gener

Re: [EVALUATION] - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Ilias Lazaridis
Martin P. Hellwig wrote: > Ilias Lazaridis wrote: > > So I guess you volunteer http://www.python.org/psf/volunteer.html ? I volunteer and contribute already (with a general validity and python specific analysis) A mediator should communicate the findings and suggestion (after verifying them) t

Redirecting both stdout and stderr to the same file

2005-12-27 Thread Randy Kreuziger
Can stdout and stderr be redirected to the same file?  I would like to redirect both to the same file but I'm not sure how to do it.  Currenting I'm redirectiong stdout using the following code:    saveout = sys.stdout   fsock = open('runtime.log', 'w')   sys.stdout = fsock   The problem is that

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Ilias Lazaridis
Harald Armin Massa wrote: [...] - (comments) Thank you for your comments. - TAG.python.evolution.negate.apotheosis . -- http://lazaridis.com -- http://mail.python.org/mailman/listinfo/python-list

Re: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Robert Hicks
Guido has never been, is not, and will not in the future be, a threat to Python. End of story. Unless of course aliens come into play. You never know. Robert -- http://mail.python.org/mailman/listinfo/python-list

Rss/xml namespaces sgmllib, sax, minidom

2005-12-27 Thread Sakcee
I want to build a simple validator for rss2 feeds, that checks basic structure and reports channels , items , and their attributes etc. I have been reading Mark Pilgrims articles on xml.com, diveintopython and someother stuff on sgmllib, sax.handlers and content handlers, xml.dom.minidom why is a

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: Redirecting both stdout and stderr to the same file

2005-12-27 Thread Kevin Yuan
You should redirecte sys.stderr if you want to log error message.   saveout = sys.stdout   saveerr = sys.stderr   fsock = open('runtime.log', 'w')   sys.stdout = sys.stderr = fsock2005/12/28, Randy Kreuziger <[EMAIL PROTECTED]>: Can stdout and stderr be redirected to the same file?  I would li

Re: html resize pics

2005-12-27 Thread Peter Hansen
rbt wrote: > What's a good way to resize pictures so that they work well on html > pages? I have large jpg files. I want the original images to remain as > they are, just resize the displayed image in the browser. These two things are mutually exclusive by most people's definition of "work well

Re: html resize pics

2005-12-27 Thread rbt
Peter Hansen wrote: > rbt wrote: >> What's a good way to resize pictures so that they work well on html >> pages? I have large jpg files. I want the original images to remain as >> they are, just resize the displayed image in the browser. > > These two things are mutually exclusive by most peopl

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: - E04 - Leadership! Google, Guido van Rossum, PSF

2005-12-27 Thread Ilias Lazaridis
Robert Hicks wrote: > Guido has never been, is not, and will not in the future be, a threat > to Python. End of story. > > Unless of course aliens come into play. You never know. > > Robert - TAG.python.evolution.negate.apotheosis.faith . -- http://lazaridis.com -- http://mail.python.org/ma

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: csv file how to modify the row

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 14:45:16 -0800, muttu2244 wrote: > Hi everybody > > > Am trying to read a csv file "temp.csv", which has the below info, > > > compName macAddripAddr > opSys > > > Chris-Dev 0003469F44CC 10.160.24.226 Microsoft > Windows XP Profess

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 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: csv file how to modify the row

2005-12-27 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Why are you calling it a Comma Separated Values file when there are no > commas separating values in it? It's common usage -- the Python standard library's csv also lets you parse files where the separator is not a comma -- you just need to have an exp

query on python list

2005-12-27 Thread muttu2244
hi all am searching for a key in a list, am using Found = 0 for item in list: if not key == item: Found = 0 elif key == item: Found =1 Now based on the Found value i ll manipulate the list. but whenever the "key and item" doesnt match it makes "Foun

Re: query on python list

2005-12-27 Thread Tim Hochberg
[EMAIL PROTECTED] wrote: > hi all > am searching for a key in a list, am using > > Found = 0 > for item in list: > if not key == item: > Found = 0 > elif key == item: > Found =1 > > Now based on the Found value i ll manipulate the list. > but whenev

Re: Beautiful Python

2005-12-27 Thread news
In article <[EMAIL PROTECTED]>, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Gekitsuu napisal(a): > > > use strict; > > use WWW::Mechanize; > > use CGI; > > > > This seems to be the de facto standard in the Perl community but in > > python it seems most of the code I look at has import statements >

Re: csv file how to modify the row

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 19:24:57 -0800, Alex Martelli wrote: > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> Why are you calling it a Comma Separated Values file when there are no >> commas separating values in it? > > It's common usage Well you learn something new every day. Of course I know abo

Re: csv file how to modify the row

2005-12-27 Thread Alex Martelli
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 27 Dec 2005 19:24:57 -0800, Alex Martelli wrote: > > > Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > > >> Why are you calling it a Comma Separated Values file when there are no > >> commas separating values in it? > > > > It's common usage >

HTMLGen- Table Align property

2005-12-27 Thread Cappy2112
Does anyone know if the table align property is available in HTMLgen.Table? The docs don't show it, but I find it hard to believe that it is not available. I want to center the table. Only the cell align propterty is available -- http://mail.python.org/mailman/listinfo/python-list

Re: query on python list

2005-12-27 Thread muttu2244
hi tim thanks for the help acutally i dint tell u the whole problem i have list of lists, for ex list1 =[ ['a','b','c','d','e'] , ['1','2','3','4'] , ['A','B','C','D'] ] and another list list2 = ['1','2','5',4] now am searching the items of list2 in list1 as below Found = True for i in list1:

  1   2   >