Re: python bug in this list implementation?

2005-12-27 Thread Fredrik Lundh
Chris Smith wrote: > I've been working on some multi-dimensional lists and I've encountered some > very strange behaviour in what appears to be simple code, I'm using python > 2.4.2 and IDLE. If anyone can tell me why it's behaving so strange please > let me know, any improvements to my general co

python bug in this list implementation?

2005-12-27 Thread Chris Smith
Hi, I've been working on some multi-dimensional lists and I've encountered some very strange behaviour in what appears to be simple code, I'm using python 2.4.2 and IDLE. If anyone can tell me why it's behaving so strange please let me know, any improvements to my general coding style are also ap

Re: fetching images from web?

2005-12-27 Thread bonono
may be using wget/curl but then it is no longer python ;-) [EMAIL PROTECTED] wrote: > hi, i want to automate some tasks of gathering photos from web, i tried > urllib/urllib2, both ended up without much success (saved gifs with > only a border, nothing else).. > > the code i used was: > > >>> data

Re: fetching images from web?

2005-12-27 Thread randomtalk
ah, wb works :D thanks alot! -- http://mail.python.org/mailman/listinfo/python-list

Re: fetching images from web?

2005-12-27 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > hi, i want to automate some tasks of gathering photos from web, i tried > urllib/urllib2, both ended up without much success (saved gifs with > only a border, nothing else).. > > the code i used was: > > >>> data = urllib2.urlopen( "http://aspn.activestate.com/ASP

Re: fetching images from web?

2005-12-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > hi, i want to automate some tasks of gathering photos from web, i tried > urllib/urllib2, both ended up without much success (saved gifs with > only a border, nothing else).. Um - what else did you expect? You fetched a gif, you should get a gif. > the code i used was:

Re: predicting function calls?

2005-12-27 Thread Mike Meyer
[EMAIL PROTECTED] (Roy Smith) writes: > Objects can have attributes (data) and operations associated with > them. It would be very convenient to use the "." syntax to access > both of these, i.e. be able to say: > > print handle.someAttribute > print handle.someOperation (arg1, arg2) > > I'm using

Re: how-to POST form data to ASP pages?

2005-12-27 Thread Mike Meyer
"livin" writes: > Mike, > I appreciate the help... I'm a noobie to Python. I know vbscript & jscript > but nothing else. > > I obviously do not need to submit the images > > my code looks like this but it is not working... any ideas? > > > params = urllib.urlencode({'action': 'hs.ExecX10ByN

fetching images from web?

2005-12-27 Thread randomtalk
hi, i want to automate some tasks of gathering photos from web, i tried urllib/urllib2, both ended up without much success (saved gifs with only a border, nothing else).. the code i used was: >>> data = >>> urllib2.urlopen("http://aspn.activestate.com/ASPN/img/komodo_aspn_other.gif";) >>> #was

Re: query on python list

2005-12-27 Thread Mike Meyer
[EMAIL PROTECTED] writes: > 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

Re: any Adobe Reader like apps written in python, for examination?

2005-12-27 Thread Alex Gittens
Yeah, pygame is not what I'm looking for. I'm looking for a good example of cross platform non-trivial page-layout and font handling. The project I'm working on-- a typographically correct interface to a CAS-- requires pixel-perfect font handling. I'll definitely look into Grail: I'm sure as a br

predicting function calls?

2005-12-27 Thread Roy Smith
I think I know the answer to this, but I'll ask it just in case there's something I hadn't considered... I'm working on a python interface to a OODB. Communication with the DB is over a TCP connection, using a model vaguely based on CORBA. I'll be creating object handles in Python which are proxi

Re: libxml2dom problems

2005-12-27 Thread ankit
Thanks .. frederik. The reason for posting the problem 2 times is that there might be some problem yesterday with the google groups server . After posting the mesage I cant see it on the board. That's why I posted again. anyway thanks for the help -- http://mail.python.org/mailman/listinfo/pytho

Re: how-to POST form data to ASP pages?

2005-12-27 Thread livin
Mike, I appreciate the help... I'm a noobie to Python. I know vbscript & jscript but nothing else. I obviously do not need to submit the images my code looks like this but it is not working... any ideas? params = urllib.urlencode({'action': 'hs.ExecX10ByName "Kitchen Espresso Machine",

Re: Beautiful Python

2005-12-27 Thread Steven D'Aprano
On Tue, 27 Dec 2005 21:35:46 -0600, news wrote: >> Sometimes putting import statements at the beginning is not feasible >> (i.e. only when some condition has been met), as importing has some >> impact on program execution (importing executes code in imported >> module). This does not resemble Java

Re: HTMLGen- Table Align property

2005-12-27 Thread Dave Benjamin
Cappy2112 wrote: > Table and TableLite are different classes. Tablelite requires a little > more work, and I will ave to rewrite some code to use it. > > I am using Table a tthe moment Well, as far as I know, wrapping a DIV align="center" around a TABLE should produce the same effect as giving t

Re: HTMLGen- Table Align property

2005-12-27 Thread Cappy2112
Table and TableLite are different classes. Tablelite requires a little more work, and I will ave to rewrite some code to use it. I am using Table a tthe moment >>ith a "style" attribute (or using the TableLite class, which also >>accepts a "style" attribute), and setting the "text-align" propert

problem with pyHook module

2005-12-27 Thread Chris Westbrook
I want to use the pyHook module to capture all keyboard input and write it to a file. I have a script that works fine with the command prompt, but I have a few issues I need help with. First, I want to be able to set up an html page that has a link to this script and have it start running and

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: help with lists and writing to file in correct order

2005-12-27 Thread homepricemaps
hey steven-your examlpe was very helpful. is there a paragraph symbolg missing in fp.write("Food = %s, store = %s, price = %s\n" % triplet Steven D'Aprano wrote: > On Mon, 26 Dec 2005 20:56:17 -0800, homepricemaps wrote: > > > sorry for asking such beginner questions but i tried this and nothing

Re: HTMLGen- Table Align property

2005-12-27 Thread Dave Benjamin
Cappy2112 wrote: > 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 >>> print HTMLgen.TableLite(align="cen

Re: HTMLGen- Table Align property

2005-12-27 Thread Dave Benjamin
Cappy2112 wrote: > 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 I've never used HTMLgen, but you might

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:

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

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

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

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

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

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

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: [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

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
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

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

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

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

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

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

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

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

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

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: 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: 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: 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: 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: 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: [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: 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: 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: 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

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)

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)

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

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

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

  1   2   >