Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Fredrik Lundh
Hendrik van Rooyen wrote: >> blue is red or green or yellow > > *grin* - this can be construed as a weakness in Python - it's boolean logic, and it's incompatible with human use of the same terms in all contexts, not just Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Fredrik Lundh
Michael Hobbs wrote: > Yeah, okay, I didn't read through the details of the PEP. I picked a bad > example to illustrate a point that is still true. The FAQ also tries to > argue that it's a Good Thing that join() is a string method, not a list > method. It also tries to argue that there's a goo

Re: Inheritance Question

2006-11-10 Thread Gabriel Genellina
At Saturday 11/11/2006 03:31, Frank Millman wrote: Continuing your analogy of animals, assume a class A with a 'walk' method and an 'eat' method. Most animals walk the same way, but a few don't, so I create a subclass AW and override the walk method. Most animals eat the same way, but a few do

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Paul Boddie wrote: > Ron Adam wrote: >> PS. Rather than shav of on character her and ther in pythons programing >> languag, Lets remov all the silent leters from the english languag. That will >> sav thousands mor kestroks over a few yers. > > How about changing Python to support keywords and ide

Re: UnboundLocalError

2006-11-10 Thread Gabriel Genellina
At Saturday 11/11/2006 02:35, Camellia wrote: But sorry I'm so dumb I can't say I really understand, what do I actually do when I define a function with its name "number"? Don't apologize, Python is a lot more dumb than you. It obeys very simple rules (a good thing, so we can clearly understa

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Steven D'Aprano wrote: > On Fri, 10 Nov 2006 21:24:50 +0100, Bjoern Schliessmann wrote: > >> Marc 'BlackJack' Rintsch wrote: >> >>> No it doesn't -- look again at the example given above. It's >>> legal syntax in Python but doesn't have the semantics implied by >>> the example. >> Sorry, I don't

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Hendrik van Rooyen
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: 8<--- > >>> color = "blue" > >>> if color == "red" or "green" or "yellow": > ... print color, "is red or green or yellow" > ... > blue is red or green or yellow *grin* - this can be construed as a wea

Re: Inheritance Question

2006-11-10 Thread Frank Millman
Jackson wrote: > I've got an inheritance question and was hoping brighter minds could > guide me. I am in the strange situation where some of the methods in a > subclass are actually more general than methods in a superclass. What > is the preferred way to handle such situations. My original th

Re: mushrooms are animals? [was Re: Py3K idea: why not drop the colon?]

2006-11-10 Thread Steven D'Aprano
On Fri, 10 Nov 2006 22:41:53 -0600, skip wrote: > > Steven> The world seems to be flat, the sun appears to rotate around the > Steven> Earth, and mushrooms look like they are more closely related to > Steven> plants than to animals, but none of these things are actually > Steven>

Re: UnboundLocalError

2006-11-10 Thread Camellia
Thank you all so much for all the replies:) But sorry I'm so dumb I can't say I really understand, what do I actually do when I define a function with its name "number"? why does a name of a function has something to do with a variable? Oh wait can I do this in Python?: def a(): def b() so

odd problem with watsup and VB6 application with modal dialog

2006-11-10 Thread Grumman
For various reasons, I've found myself in the position of needing to automate the operation of a small VB6 application from an external process. After a bit of searching, I found watsup, and it has fit the bill nicely, except for one problem. Roughly, I have a script that fills in a field, sets

mushrooms are animals? [was Re: Py3K idea: why not drop the colon?]

2006-11-10 Thread skip
Steven> The world seems to be flat, the sun appears to rotate around the Steven> Earth, and mushrooms look like they are more closely related to Steven> plants than to animals, but none of these things are actually Steven> the case. Where can I read about mushrooms as animals? Sk

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Peter Decker
On 9 Nov 2006 09:13:00 -0800, Dan Lenski <[EMAIL PROTECTED]> wrote: > Nick and John S., thank you for the tip on wxPython! I'll look into it > for my next project. I too would avoid Qt, not because of the GPL but > simply because I don't use KDE under Linux and because Qt is not well > supported

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Bill Maxwell
On 9 Nov 2006 22:48:10 -0800, "John Henry" <[EMAIL PROTECTED]> wrote: >Upon closer look, the walkthrough did say: > >*** >from PythonCard import model > >Change that so it says: > >from PythonCard import dialog, model > >Save the code. >*** > >So, it

Re: PDF to text script

2006-11-10 Thread Nick Vatamaniuc
Vyz wrote: > I am looking for a PDF to text script. I am working with multibyte > language PDFs on Windows Xp. I need to batch convert them to text and > feed into an encoding converter program > > Thanks for any help in this regard Multibyte languages are not easy. I do text extraction from PDF

Re: Inheritance Question

2006-11-10 Thread George Sakkis
Gabriel Genellina wrote: > If walking in general, have some common structure, you can put the > "sketch" on Legs and let the derived classes "fill the gaps". This is > known as "Template Method Pattern" - look for it. Or if you'd rather see a concrete example, here's how your toy example would lo

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Bjoern Schliessmann
Steven D'Aprano wrote: > And just for the avoidance of doubt, Python "x == blue or red or > yellow" is semantically equivalent to: > > (x == blue) or bool(red) or bool(yellow) Yep, got it. Shame on me, it's so obvious now :) Regards, Björn -- BOFH excuse #317: Internet exceeded Luser level

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steven D'Aprano
On Fri, 10 Nov 2006 13:16:32 -0600, Michael Hobbs wrote: > Yeah, okay, I didn't read through the details of the PEP. I picked a bad > example to illustrate a point that is still true. The FAQ also tries to > argue that it's a Good Thing that join() is a string method, not a list > method. It al

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Paul Boddie
Ron Adam wrote: > > PS. Rather than shav of on character her and ther in pythons programing > languag, Lets remov all the silent leters from the english languag. That will > sav thousands mor kestroks over a few yers. How about changing Python to support keywords and identifiers employing the Ini

Re: Inheritance Question

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 21:13, Jackson wrote: I've got an inheritance question and was hoping brighter minds could guide me. I am in the strange situation where some of the methods in a subclass are actually more general than methods in a superclass. What is the preferred way to handle such situa

wsdl question

2006-11-10 Thread Yusnel Rojas García
hi, Can anyone tell me how to create a soap web service and generate it's WSDL file?? I've tried so har to do so but no results. cheers OnemoverX -- http://mail.python.org/mailman/listinfo/python-list

Re: string to list of numbers conversion

2006-11-10 Thread Tim Williams
On 5 Nov 2006 04:34:32 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > I have a string '((1,2), (3,4))' and I want to convert this into a > python tuple of numbers. But I do not want to use eval() because I do > not want to execute any code in that string and limit it to list of > num

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread James Cunningham
On 2006-11-09 14:06:06 -0500, "Dan Lenski" <[EMAIL PROTECTED]> said: > [snip] > > My understanding is that wx wraps Windows, OSX, Qt, and GTK+... I guess > some of the wrappers fit the native apps better than others? > > Dan WxWidgets does wrap Windows, OS X (Carbon), and GTK; it does not wrap

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steven D'Aprano
On Fri, 10 Nov 2006 15:18:55 -0600, Michael Hobbs wrote: > Ron Adam wrote: >> It is also an outline form that frequently used in written languages. >> Something >> python tries to do, is to be readable as if it were written in plain >> language >> where it is practical to do so. So the colon

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steven D'Aprano
On Fri, 10 Nov 2006 10:37:08 -0600, Michael Hobbs wrote: > The FAQ says that the colon increases > readability, but I'm skeptical. The indentation seems to provide more > than enough of a visual clue as to where the if conditional ends. and then in a later post: > Like I said in that paragraph,

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steven D'Aprano
On Fri, 10 Nov 2006 21:24:50 +0100, Bjoern Schliessmann wrote: > Marc 'BlackJack' Rintsch wrote: > >> No it doesn't -- look again at the example given above. It's >> legal syntax in Python but doesn't have the semantics implied by >> the example. > > Sorry, I don't understand -- what is the dif

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-10 Thread Andrew MacIntyre
Robin Becker wrote: > Robin Becker wrote: >> Andrew MacIntyre wrote: >>> Robin Becker wrote: >>> I think it uses sysv semaphores and although freeBSD 6 has them perhaps there's something I need to do to allow them to work. >>> IIRC, you need to explicitly configure loading the kernel mod

Re: Why can't you pickle instancemethods?

2006-11-10 Thread mdsteele
Steven Bethard wrote: > Here's the recipe I use:: > > [...] > > There may be some special cases where this fails, but I haven't run into > them yet. Wow, that's a really nice recipe; I didn't even know about the copy_reg module. I'll have to start using that. I did notice one failure mode,

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> It is also an outline form that frequently used in written languages. >> Something >> python tries to do, is to be readable as if it were written in plain >> language >> where it is practical to do so. So the colon/outline form makes a certain >> sen

Inheritance Question

2006-11-10 Thread Jackson
I've got an inheritance question and was hoping brighter minds could guide me. I am in the strange situation where some of the methods in a subclass are actually more general than methods in a superclass. What is the preferred way to handle such situations. My original thought was to do somethin

Re: PDF to text script

2006-11-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Vyz <[EMAIL PROTECTED]> wrote: >I am looking for a PDF to text script. I am working with multibyte >language PDFs on Windows Xp. I need to batch convert them to text and >feed into an encoding converter program > >Thanks for any help in this regard > http://phaseit.

Re: how is python not the same as java?

2006-11-10 Thread [EMAIL PROTECTED]
You can get educated in java through manpower for free just apply for a job(through thier online learning thing) but you can't add python to your plan. :( They have pearl, c, basic, cobol also but no python. https://sourceforge.net/project/showfiles.php?group_id=156455 gavino wrote: > both

Re: Python 2.5 Core Dump on Solaris 8

2006-11-10 Thread Martin v. Löwis
Melissa Evans schrieb: > I've modified grappy.py, > http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy > daemon for greylisting. to use LDAP as a backend instead of SQL (with > python-ldap.) The daemon runs fine when testing but when I put it under > load it core dumps quickly.

Re: urlretrieve get file name

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 16:58, Sven wrote: Yes the browser suggests a file name, but I did a little research using http://web-sniffer.net/. The Response Header contains roughly this: HTTP Status Code: HTTP/1.1 302 Found Location: http://page.com/filename.zip Content-Length: 0 Connection: close Con

Re: how is python not the same as java?

2006-11-10 Thread Jorge Godoy
"Jorge Vargas" <[EMAIL PROTECTED]> writes: > code. In python noone runs the pyc files, the interpreter takes care > of this for you. This is not true. It is one way to avoid having your source lying around. The same can be done with .pyo... -- Jorge Godoy <[EMAIL PROTECTED]> -- http://m

Tkinter: How do I change the actual width of a widget?

2006-11-10 Thread Mudcat
I am trying to change the width of a widget based on pixel size and not on characters. I can't figure out how to do this. Normally to change to the size of a widget it looks like: widget.configure(width = x) However that is in characters, not in pixels. To retrieve the actual size of a widget, I

Re: handling many default values

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 14:11, Alan G Isaac wrote: My class MyClass reuses many default parameters with a small number of changes in each instance. For various reasons I decided to put all the parameters in a separate Params class, instances of which reset the default values based on keyword argume

Re: comparing Unicode and string

2006-11-10 Thread Leo Kislov
Neil Cerutti wrote: > On 2006-11-10, Steve Holden <[EMAIL PROTECTED]> wrote: > >>> But I don't insist on my PEP. The example just shows just > >>> another pitfall with Unicode and why I'll advise to any > >>> beginner: Never write text constants that contain non-ascii > >>> chars as simple strings,

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 18:05, consternation wrote: def __init__ self.mem={} I googled a way how to add elements to dict, I have read the code not the description below self.mem[key] = value I strongly suggest you read some introductory Python docs, like http://docs.python.org/tut/tut.html o

Re: service windows avec py2exe

2006-11-10 Thread Gabriel Genellina
At Friday 10/11/2006 08:15, DarkPearl wrote: >apres avoir créer un service windows avec py2exe, >j'ai ce probleme quand je lance le service : > >voici ce que je trouve dans le journal d'evenement : > >The instance's SvcRun() method failed >: (-2147221020, 'Syntaxe incorrecte', >None, None) Try wi

Python 2.5 Core Dump on Solaris 8

2006-11-10 Thread Melissa Evans
Hi. I'm new to Python. :) I've modified grappy.py, http://www.stacken.kth.se/~mattiasa/projects/grappy/, a postfix policy daemon for greylisting. to use LDAP as a backend instead of SQL (with python-ldap.) The daemon runs fine when testing but when I put it under load it core dumps quickly.

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Bjoern Schliessmann
Fredrik Lundh wrote: > >>> color = "blue" > >>> if color == "red" or "green" or "yellow": > ... print color, "is red or green or yellow" > ... > blue is red or green or yellow Whoops. Okay. Regards, Björn -- BOFH excuse #303: fractal radiation jamming the backbone -- http://mail.pyt

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ron Adam wrote: > It is also an outline form that frequently used in written languages. > Something > python tries to do, is to be readable as if it were written in plain language > where it is practical to do so. So the colon/outline form makes a certain > sense > in that case as well. >

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
I think I know now where my problems come from. I spare you boring implementation code. The case look like this: I parse xml file something a like 1 <\a> 2 <\a> 3 <\a> 4<\b> <\X> <\a> <\a> <\a> <\b> <\X> I suc

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steve Holden
James Cunningham wrote: > On 2006-11-10 15:24:50 -0500, Bjoern Schliessmann > <[EMAIL PROTECTED]> said: > >> Marc 'BlackJack' Rintsch wrote: >> >>> No it doesn't -- look again at the example given above. It's >>> legal syntax in Python but doesn't have the semantics implied by >>> the example. >

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Michael Hobbs wrote: > Ron Adam wrote: >> The faq also pointed out a technical reason for requiring the colon. It >> makes >> the underlying parser much easier to write and maintain. This shouldn't be >> taken to lightly in my opinion, because a simpler easer to maintain and more >> reliable

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread James Cunningham
On 2006-11-10 15:47:42 -0500, Max Erickson <[EMAIL PROTECTED]> said: color='orange' if color=='red' or 'blue' or 'green': > print "Works?" > > > Works? No! No no no. I won't hear of it. Don't you know that with insufficient test cases, everything is right? Sheesh. Best,

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Max Erickson
>>> color='orange' >>> if color=='red' or 'blue' or 'green': print "Works?" Works? >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Fredrik Lundh
Bjoern Schliessmann wrote: > Marc 'BlackJack' Rintsch wrote: > >> No it doesn't -- look again at the example given above. It's >> legal syntax in Python but doesn't have the semantics implied by >> the example. > > Sorry, I don't understand -- what is the difference between the > example as it

Re: Modules, Packages and Developer Confusion. Oh My!

2006-11-10 Thread Steve Holden
[EMAIL PROTECTED] wrote: > I think I'm still missing something in how python is handling packages > and it's mixing me up. I have a package with three files (modules?) > like so: > > OPS:\ > __init__.py > model.py > search.py > > To hide more details of the package structure, I import model

Re: Modules, Packages and Developer Confusion. Oh My!

2006-11-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > from model import * > from search import * > > def create_connection(): > # details are unimportant for this example > > > When I try to use the create_connection function in model, I get errors > when I use it as a global function ( just create_connection()). impo

Re: how is python not the same as java?

2006-11-10 Thread John Machin
Jorge Vargas wrote: > On 9 Nov 2006 18:09:37 -0800, John Machin <[EMAIL PROTECTED]> wrote: > > > > Jorge Vargas wrote: > > > On 9 Nov 2006 16:44:40 -0800, gavino <[EMAIL PROTECTED]> wrote: > > > > both are interpreted oo langauges.. > > > > > > > that is not correct java is compiled and the VM

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Fredrik Lundh
John Salerno wrote: >> Anyway, the FAQ answer seems to be a >> weak argument to me. > > I agree. I was expecting something more technical to justify the colon, > not just that it looks better. yeah, the whole idea of treating programming languages as an interface between people and computers

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread James Cunningham
On 2006-11-10 15:24:50 -0500, Bjoern Schliessmann <[EMAIL PROTECTED]> said: > Marc 'BlackJack' Rintsch wrote: > >> No it doesn't -- look again at the example given above. It's >> legal syntax in Python but doesn't have the semantics implied by >> the example. > > Sorry, I don't understand -- w

Re: newbie: minidom

2006-11-10 Thread Paul Boddie
Danny Scalenotti wrote: > I'm not able to get out of this ... > > > from xml.dom.minidom import getDOMImplementation > > impl = getDOMImplementation() // default UTF-8 > doc = impl.createDocument(None, "test",None) > root = doc.documentElement Here, you're actually getting a reference to the

Modules, Packages and Developer Confusion. Oh My!

2006-11-10 Thread [EMAIL PROTECTED]
I think I'm still missing something in how python is handling packages and it's mixing me up. I have a package with three files (modules?) like so: OPS:\ __init__.py model.py search.py To hide more details of the package structure, I import model and search inside of __init__. It also seeme

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Bjoern Schliessmann
Marc 'BlackJack' Rintsch wrote: > No it doesn't -- look again at the example given above. It's > legal syntax in Python but doesn't have the semantics implied by > the example. Sorry, I don't understand -- what is the difference between the example as it is and the implied semantics of it? Rega

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread John Machin
ronrsr wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() Don't give us one line; give us the whole of the imported module plus the calling script (at least up to the place where it gets the error). That way we can see what is really going on, and someone wit

Re: announce: FAQs suggested

2006-11-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: >> > > > http://effbot.org/pyfaq/suggest.htm >> > > FAQ: How do I say returns void in ctypes? >> > That's in the ctypes documentation, where it belongs. >> >> Thank you, before I never had found "Use None for void a function not >> returning anything" at: >> http://starsh

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Steve Holden
ronrsr wrote: > the syntax error comes in the main program, in any line that follows > the import statement. > in which case, don't you think it might be the "import" statement that's causing the problem. What is stopping you from showing us the whole source? Or at least the import statement as

Re: announce: FAQs suggested

2006-11-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: > Thanks again for making time to comment - insights into the perspective > of the author are invaluable. But if by chance you have time to > continue: > >> > > http://effbot.org/pyfaq/suggest.htm >> > http://docs.python.org/dev/lib/ctypes-return-types.html >> A note co

Re: comparing Unicode and string

2006-11-10 Thread Neil Cerutti
On 2006-11-10, Steve Holden <[EMAIL PROTECTED]> wrote: >>> But I don't insist on my PEP. The example just shows just >>> another pitfall with Unicode and why I'll advise to any >>> beginner: Never write text constants that contain non-ascii >>> chars as simple strings, always make them Unicode stri

Re: urlretrieve get file name

2006-11-10 Thread Sven
Yes the browser suggests a file name, but I did a little research using http://web-sniffer.net/. The Response Header contains roughly this: HTTP Status Code: HTTP/1.1 302 Found Location: http://page.com/filename.zip Content-Length: 0 Connection: close Content-Type: text/html The status code 302 t

PDF to text script

2006-11-10 Thread Vyz
I am looking for a PDF to text script. I am working with multibyte language PDFs on Windows Xp. I need to batch convert them to text and feed into an encoding converter program Thanks for any help in this regard -- http://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Fredrik Lundh
"ronrsr" <[EMAIL PROTECTED]> wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() individual statements don't "trigger" syntax errors; they're compiler errors, and only appear when do something that causes code to be compiled. > exact error message: SyntaxEr

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ron Adam wrote: > The faq also pointed out a technical reason for requiring the colon. It > makes > the underlying parser much easier to write and maintain. This shouldn't be > taken to lightly in my opinion, because a simpler easer to maintain and more > reliable python parser means developm

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread skip
Replying via Steve's not to (I think) a comment from Michael Hobbs (apologies to Steve): >> The FAQ says that the colon increases readability, but I'm >> skeptical. The indentation seems to provide more than enough of a >> visual clue as to where the if conditional ends. I use four-sp

Re: Getting externally-facing IP address?

2006-11-10 Thread Laszlo Nagy
Michael B. Trausch wrote: > Hello, > > Every programming example that I have seen thus far shows simple > server code and how to bind to a socket--however, every example binds > to the localhost address. What I am wondering is this: Is there a > clean way to get the networked IP address of the

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Steve Holden wrote: > Michael Hobbs wrote: > >> Ben Finney wrote: >> > [...] > >>> A use case. What problem is being solved by introducing this >>> inconsistency? >>> >>> >> The same problem that is solved by not having to type parens around the >> 'if' conditional, a la C and

Re: range syntax

2006-11-10 Thread Antoon Pardon
On 2006-11-10, Roberto Bonvallet <[EMAIL PROTECTED]> wrote: > Colin J. Williams wrote: >> One of the little irritants of Python is that the range syntax is rather >> long-winded: >> [Dbg]>>> range(3, 20, 6) >> [3, 9, 15] >> [Dbg]>>> >> It would be nice if one could have something like 3:20:6. > >

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Ron Adam
Michael Hobbs wrote: > The same problem that is solved by not having to type parens around the > 'if' conditional, a la C and its derivatives. That is, it's unnecessary > typing to no good advantage, IMHO. I was coding in Ruby for several > months and got very comfortable with just typing the i

Re: newbie: minidom

2006-11-10 Thread Fredrik Lundh
Danny Scalenotti wrote: > I'm not able to get out of this ... > > from xml.dom.minidom import getDOMImplementation > > impl = getDOMImplementation() // default UTF-8 > doc = impl.createDocument(None, "test",None) > root = doc.documentElement > root.setAttribute('myattrib', '5') > > print

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steve Holden
Bjoern Schliessmann wrote: > Michael Hobbs wrote: > >> That is, assume that the expression ends at the colon, not at the >> newline. That would make this type of statement possible: >> if color == red or >> color == blue or >> color == green: >> return 'primary' >> Right no

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Steve Holden
Michael Hobbs wrote: > Ben Finney wrote: [...] >> A use case. What problem is being solved by introducing this >> inconsistency? >> > The same problem that is solved by not having to type parens around the > 'if' conditional, a la C and its derivatives. That is, it's unnecessary > typing to no

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Jerry Hill
On 11/10/06, consternation <[EMAIL PROTECTED]> wrote: result:isinstance(x,X)Falsetype(x) is XFalselistI think you need to show us more of your code.  Your variable, v, is not of type X in this example.  Instead, it is of type list.  What is self.mem.items()?  It isn't a dictionary like your commen

Re: comparing Unicode and string

2006-11-10 Thread Steve Holden
Neil Cerutti wrote: > On 2006-11-10, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> Marc 'BlackJack' Rintsch wrote: >>> Why? Python strings are *byte strings* and bytes have values in the range >>> 0..255. Why would you restrict them to ASCII only? >> Because getting an exception when comparing

Re: RAW network programming under Windows

2006-11-10 Thread billie
sturlamolden wrote: > You can try to install "Windows Services for Unix 3.5" (aka SFU 3.5). > It transforms your Windows into a certified UNIX (not just a Unix > clone). SFU 3.5 has a full BSD socket API (derived from OpenBSD), not > just Winsock. As the POSIX subsystem in SFU 3.5 is not layered o

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread skip
Robert> [EMAIL PROTECTED] wrote: >> P.S. I felt I just had to tie this into the thread on profanity somehow. >> But notice that I didn't mention nazis or Hitler. ;-) Robert> You did it just now! Hence the smiley. ;-) S -- http://mail.python.org/mailman/listinfo/python-list

Re: Need help with Subversion bindings

2006-11-10 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > I'm trying to write a basic Subversion client because I need to > integrate Subversion with a product that keeps source code in a > database (so it has no notion of "working copy"). > > I have tried to translate the simple C examples in Garrett Rooney's > book into Pyt

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Bjoern Schliessmann wrote: > Neil Cerutti wrote: >> On 2006-11-09, Bjoern Schliessmann > >>> if color == red or blue or green: >>> return 'primary' >>> >>>:) > >> The Inform 6* programming language supports the serial 'or' (and >> 'and') and looks just like that. >

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
the syntax error comes in the main program, in any line that follows the import statement. ronrsr wrote: > the exact code that is triggering the error message is: > > zc = zsql.connect() > > > exact error message: SyntaxError: Invalid Syntax > > > but any statement that follows the import state

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
the exact code that is triggering the error message is: zc = zsql.connect() exact error message: SyntaxError: Invalid Syntax but any statement that follows the import statement will trigger it. bests, r-sr- Roberto Bonvallet wrote: > ronrsr wrote: > > thanks for the speedy answer. wha

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Roberto Bonvallet
ronrsr wrote: > thanks for the speedy answer. what i meant was: > > return MySQLdb.connect (host = "db91b.pair.com", > user = "homebase", >passwd = "Newspaper2", >db = "homebase_zingers" > );

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, consternation wrote: > Thank You for reply but > I found solution suggested by You in a tutorial yesterday. For some reason > it doesn't work in my case. > > code: > #mem-dictionary in Y class for storing objects > #Y doesn't inherit from X > for (i,v) in self.m

handling many default values

2006-11-10 Thread Alan G Isaac
My class MyClass reuses many default parameters with a small number of changes in each instance. For various reasons I decided to put all the parameters in a separate Params class, instances of which reset the default values based on keyword arguments, like this: class Params: def __init__(se

Re: range syntax

2006-11-10 Thread Fredrik Lundh
Colin J. Williams wrote: > One of the little irritants of Python is that the range syntax is rather > long-winded: > [Dbg]>>> range(3, 20, 6) > [3, 9, 15] > [Dbg]>>> > It would be nice if one could have something like 3:20:6. if you find yourself using range a lot, maybe you should check if you

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
thanks for the speedy answer. what i meant was: return MySQLdb.connect (host = "db91b.pair.com", user = "homebase", passwd = "Newspaper2", db = "homebase_zingers" ); but even when I have

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, ronrsr wrote: > def connect(): > > >return = MySQLdb.connect (host = "db91x..com", ^ You can't assign to a keyword. Just leave this ``=`` out. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
here's some of the surrounding code from the main program: querystring = querystring + " ORDER BY keywords "; #SQL import zsql zc = zsql.connect() print("return from open") zq = zc.query(querystring).dictresult() ronrsr wrote: > no matter where I place this imported file,the statement

Re: SyntaxError: Invalid Syntax.

2006-11-10 Thread Roberto Bonvallet
ronrsr wrote: > return = MySQLdb.connect (host = "db91x..com", > user = "", >passwd = "x", >db = "homebase_zingers" > ); return is a reserved keyword. You cannot have a variable

Re: path.py and directory naming: trailing slash automatic?

2006-11-10 Thread Max Erickson
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I'm a big fan of path.py. One thing that I think is a good idea > is for directories to automatically have a slash appended to them > if it is not automatically added. Eg: > > from path import path > > dir = path('/some/dir') > > x = dir

SyntaxError: Invalid Syntax.

2006-11-10 Thread ronrsr
no matter where I place this imported file,the statement after it in the main program gets a syntax error, regardless of the syntax. I think I may have changed something in this file, but I'm stuck. Can anyone help? #!/usr/local/bin/python # Copyright 2004 by Stephen Masterman #Change the db co

newbie: minidom

2006-11-10 Thread Danny Scalenotti
I'm not able to get out of this ... from xml.dom.minidom import getDOMImplementation impl = getDOMImplementation() // default UTF-8 doc = impl.createDocument(None, "test",None) root = doc.documentElement root.setAttribute('myattrib', '5') print root.toxml() I obtain why not this?

Re: newbee I have an object how to check what's his class?

2006-11-10 Thread consternation
Thank You for reply but I found solution suggested by You in a tutorial yesterday. For some reason it doesn't work in my case. code: #mem-dictionary in Y class for storing objects #Y doesn't inherit from X for (i,v) in self.mem.items(): print " isinstance(x,X)" print isins

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Neil Cerutti
On 2006-11-10, Robert Kern <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> P.S. I felt I just had to tie this into the thread on >> profanity somehow. But notice that I didn't mention nazis or >> Hitler. ;-) > > You did it just now! I hate Godwin's Law Nazis. ;-) -- Neil Cerutti Scout

Re: announce: FAQs suggested

2006-11-10 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: >>> http://docs.python.org/dev/lib/ctypes-return-types.html >> >> A note could probably be added to this section. > > Good. Next: Is there a place on the web where we can log that > conclusion to inspire its resolution? ideally, you'd click "add a comment" on the relev

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Neil Cerutti
On 2006-11-10, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> On 2006-11-09, Bjoern Schliessmann > >>> if color == red or blue or green: >>> return 'primary' >>> >>>:) > >> The Inform 6* programming language supports the serial 'or' (and >> 'and') and looks just like

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Michael Hobbs
Ben Finney wrote: > Please don't hide your new thread as a reply to an existing, unrelated > message. Start a new message if your message isn't actually a reply. > > My apologies. My email client was apparently hiding some important headers from me. >> The colon that divides the statement ther

Re: how is python not the same as java?

2006-11-10 Thread Boris Borcic
Jorge Vargas wrote: > can you open a commandline and start writting java code? beanshell, iirc -- http://mail.python.org/mailman/listinfo/python-list

Re: range syntax

2006-11-10 Thread Roberto Bonvallet
Colin J. Williams wrote: > One of the little irritants of Python is that the range syntax is rather > long-winded: > [Dbg]>>> range(3, 20, 6) > [3, 9, 15] > [Dbg]>>> > It would be nice if one could have something like 3:20:6. In that case, how would the parser know which colon terminates the 'for

  1   2   >