Re: how is python not the same as java?

2006-11-10 Thread Steve Holden
Ben Finney wrote: Steve Holden [EMAIL PROTECTED] writes: Java is horrible, Oython is not. Is that the predecessor to Python, the one that could only be expressed in vowel noises? You're taking the oiss, right? regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Eric Brunel
On Thu, 09 Nov 2006 23:51:31 +0100, Dan Lenski [EMAIL PROTECTED] wrote: One other thing I'm wondering: how exactly does Tkinter work? Is the whole Tk toolkit bound up as library of low-level C code, or does Tkinter sit on top of a Tcl interpreter? The latter: there is a tiny C layer allowing

Re: Printing to file, how do I do it efficiently?

2006-11-10 Thread Cameron Walsh
Robert Kern wrote: Cameron Walsh wrote: Hi all, I have a numpy.array of 89x512x512 uint8's, set up with code like this: numpy questions are best asked on the numpy list, not here. At first I thought it was a generic python question, since it had more to do with writing array data to file

Re: how is python not the same as java?

2006-11-10 Thread Michele Simionato
gavino wrote: both are interpreted oo langauges.. Notice that gavino has a long history of asking trollish questions in Lisp and Scheme newsgroups and he displays the typical behavior of a troll. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Eric Brunel
On Thu, 09 Nov 2006 22:01:51 +0100, Dan Lenski [EMAIL PROTECTED] wrote: Tk 8.4 appears to use native Win32 widgets under Cygwin and native WinXP. It seems to depend on the widget type, and on what you call native... For example, tk menus are definitely the native ones; tk scrollbars are the

Re: how is python not the same as java?

2006-11-10 Thread Ben Finney
Steve Holden [EMAIL PROTECTED] writes: Ben Finney wrote: Steve Holden [EMAIL PROTECTED] writes: Java is horrible, Oython is not. Is that the predecessor to Python, the one that could only be expressed in vowel noises? You're taking the oiss, right? Oardon. I never meant to ooke fun

Re: Simple question to split

2006-11-10 Thread cppasm
a.split(',') -- http://mail.python.org/mailman/listinfo/python-list

Localized (international) informations on WXP

2006-11-10 Thread durumdara
Hi ! WXP, Py2.4.3. I want to get localized informations like month names, format parameters, etc. But nl_langinfo is not exists. Have the Python a way to get these informations in uniformed way (like php) to avoid multiplatform problems ? Thanks for help: dd --

Re: to Doctest as SystemExit is to Python

2006-11-10 Thread Peter Otten
[EMAIL PROTECTED] wrote: Can I somehow tell doctest that it's time to quit? Hit Ctrl-C. Or raise a KeyboardInterrupt: import sys class ExitDoctest(KeyboardInterrupt): pass def f(what): f(alpha) 'alpha' f(e) 'e' f(x) 'x' f(X) 'X' f(beta)

Re: Localized (international) informations on WXP

2006-11-10 Thread Martin v. Löwis
durumdara schrieb: I want to get localized informations like month names, format parameters, etc. Month names are available through calendar.month_name. Format parameters are available through locale.localeconv. Have the Python a way to get these informations in uniformed way (like php) to

Re: Tkinter check box behaviour - Windows / Linux discrepancy

2006-11-10 Thread peter
Thank you for those suggestions I've tried it on Windows and it seems fine (with the minor change to command=self.chkTest_click). I'm currently at work, with no access to Linux, so can't test it there until this evening. Muchas gracias! -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter check box behaviour - Windows / Linux discrepancy

2006-11-10 Thread peter
Thank you for those suggestions I've tried it on Windows and it seems fine (with the minor change to command=self.chkTest_click). I'm currently at work, with no access to Linux, so can't test it there until this evening. Muchas gracias! -- http://mail.python.org/mailman/listinfo/python-list

Create shared folder in server

2006-11-10 Thread Enrique Palomo
Title: Create shared folder in server Hi all, I'm doing some test to create and share folders in another pc. I'm executing an example found googling and works fine in my own pc, but executing from another (ping is ok) raises an access denied error. I've included the entry shinfo['user'],

Localization - set to default on Windows

2006-11-10 Thread durumdara
Hi ! I want to set default locale on WXP. I want to create a formatting tool that can set up format locale in the init, and next the formatter functions are use these settings. Example: fmtunit: --- SetLocaleToDefault() def ToUnicode(text, encoding = None): if encoding == None:

python wiki question

2006-11-10 Thread ruud habets
Hi, Does anybody know how to determine if a wiki page is a redirectpage using the wikipedia-scripts? It must be something like if IsRedirectPage() == False: text_file.write(\n) But I cannot seem to get it working. thnx Ruud -- http://mail.python.org/mailman/listinfo/python-list

Re: how is python not the same as java?

2006-11-10 Thread Bruno Desthuilliers
gavino wrote: both are interpreted oo langauges.. Being interpreted or whatever is a feature of an *implementation*, not of a language. FWIW, CPython (the reference implementation) is compiled to byte-code, that is then executed by a virtual machine. And Sun's Java implementation works the

Re: how is python not the same as java?

2006-11-10 Thread Bruno Desthuilliers
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 interprets the code So are CPython and IronPython. -- bruno desthuilliers python -c print '@'.join(['.'.join([w[::-1]

Re: python wiki question

2006-11-10 Thread ruud habets
ruud habets schreef: Hi, Does anybody know how to determine if a wiki page is a redirectpage using the wikipedia-scripts? It must be something like if IsRedirectPage() == False: text_file.write(\n) But I cannot seem to get it working. thnx Ruud problem solved: def

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

2006-11-10 Thread Robin Becker
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 module, or compile the kernel with the

Re: Newb: installing Jython on Windows XP ...

2006-11-10 Thread Marcus Bajohr
donkeyboy wrote: All, I'm having issues installing Jython on Windows XP. I've looked on the web and this newsgroup but to no avail. Any suggestions? The shell listing is below: NB I've got Cygwin installed, hence the Unix 'ls' on a Windows box C:\cd Jython C:\Jythonls

Re: substring search without using built in utils

2006-11-10 Thread [EMAIL PROTECTED]
My lecture Mustafa Başer give me the same homework.But u have to check similar algorithm at c then you can manipulate the same functions for python.Cause other languages (except C#, java etc.) does not have a strong library as python.Or alternatively you can check the source codes too see

pythoncom and dialog

2006-11-10 Thread ChristianHahn
Hi, I inherited a piece of code, that doesn't work anymore. It's a COM-object. One interface method opens a modal dialog ( OpenDialog() ), with the other methods one can set the values for a ComboBox or query the input of the user. This COM-module is istantiated(?) via

Re: how is python not the same as java?

2006-11-10 Thread Paul Boddie
Ray wrote: [EMAIL PROTECTED] wrote: Jython exists. And Pava (or Pyava) doesn't, you mean? Proof of concept only: http://www.boddie.org.uk/python/javaclass.html If there were any really compelling libraries for Java that really had to be available for CPython programs, I'd probably have

Re: Newb: installing Jython on Windows XP ...

2006-11-10 Thread Ant
On 10 Nov, 10:29, Marcus Bajohr [EMAIL PROTECTED] wrote: donkeyboy wrote: All, I'm having issues installing Jython on Windows XP. I've looked on the ... Any help would be of great use!!! Try it from cmd, not from the cygwin shell. The environments differ ! Looking at the command

Re: win32com/python different behavour.

2006-11-10 Thread Roger Upole
bli wrote: I have been developing an application driving a device through COM. I used win32com (brilliant ) and was at a fairly advanced stage being able to access the functions of the device and access/ retrieve its data. A week or two ago I did some overdue upgrading to all the components of

service windows avec py2exe

2006-11-10 Thread DarkPearl
Bonjour à tous, 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 Error getting traceback - traceback.print_tb() failed class 'pywintypes.com_error':

Re: Searching for a module to generate GUI events

2006-11-10 Thread Paul Boddie
Stephan Kuhagen wrote: utabintarbo wrote: http://pywinauto.pbwiki.com/ for Win32 Thanks for the hint, looks usable. But it seems, there's nothing for X11 and MacOSX. I didn't thought, that the problem would be so unusual... Searching for Python GUI testing on Google gave this as the first

windows service with SNMP

2006-11-10 Thread DarkPearl
Sorry for language, i wanted post in FR.comp.lang.python. But... hello with all, after having to create a Windows service with py2exe, I have this problem when I launch the service: here what I find in the eventLog: The instance's SvcRun() method failed Error getting traceback -

Re: how is python not the same as java?

2006-11-10 Thread robert
gavino wrote: both are interpreted oo langauges.. Thinks the first FAQs and tutorials about Python answer this question in detail. Theoreticalls you'd start off thinking this: * Java is a stiff typing language (as old C/C++/Pascal... and even Perl are also ). * Python is a dynamic

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Jeremy Sanders
Dan Lenski wrote: My apologies! I'm glad to be corrected on this. There are Cygwin packages for Qt as well, but I have heard about enough bugs to think I should avoid Qt. I have used enough Gtk apps that run flawlessly under Windows to have my hopes that it works well. You normally use

Re: comparing Unicode and string

2006-11-10 Thread Neil Cerutti
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 a string with a unicode string

Re: comparing Unicode and string

2006-11-10 Thread Neil Cerutti
On 2006-11-10, John Machin [EMAIL PROTECTED] wrote: Neil Cerutti wrote: On 2006-10-16, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, here is something that surprises me. #coding: iso-8859-1 I think that's supposed to be: # -*- coding: iso-8859-1 -*- Not quite. As PEP 263

Re: how is python not the same as java?

2006-11-10 Thread Neil Cerutti
On 2006-11-10, gavino [EMAIL PROTECTED] wrote: both are interpreted oo langauges.. ... -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

PythonWin Editor Freezes System

2006-11-10 Thread brettjasoncohen
When stepping through a program in the PythonWin Editor, sometimes the rest of my system becomes unresponsive, espescially the program menu items (File, Edit, ..., Help). Help! Brett -- http://mail.python.org/mailman/listinfo/python-list

Re: how is python not the same as java?

2006-11-10 Thread [EMAIL PROTECTED]
gavino wrote: both are interpreted oo langauges.. How are LANs (http://en.wikipedia.org/wiki/LAN) and porns stars (http://en.wikipedia.org/wiki/Gauge_%28porn_star%29) related to Java, Python, Programming paradigms and trolls? ask Gavino! --

announce: FAQs suggested

2006-11-10 Thread p . lavarre
http://effbot.org/pyfaq/suggest.htm has new FAQ's: FAQ: How do I ask to exit from a doctest FAQ: How do I say unsigned char in ctypes? FAQ: How do I say returns void in ctypes? FAQ: How do I calculate what quoted strings and numbers mean? Enjoy, Pat LaVarre --

Back Slash not allowed at the end of raw string?

2006-11-10 Thread yuhao
Title: Mail I'm using Python 2.5 on Windows XP Pro. While testing for strings, I got the following result: r'c:\'SyntaxError: EOL while scanning single-quoted string r'c:\nwin''c:\\nwin' r"c:\"SyntaxError: EOL while scanning single-quoted string r'\n''\\n' r'\"''\\"' It seemed

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Neil Cerutti
On 2006-11-10, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 09 Nov 2006 14:44:21 -0600, Tim Chase [EMAIL PROTECTED] declaimed the following in comp.lang.python: A few arbitrary warts per-dictum of BDFL are fine though...it still looks much cleaner compared to PHP Perl ;-) Or

Re: announce: FAQs suggested

2006-11-10 Thread Peter Otten
[EMAIL PROTECTED] wrote: http://effbot.org/pyfaq/suggest.htm has new FAQ's: FAQ: How do I ask to exit from a doctest I don't consider that question /frequently/ /asked/ or that feature frequently requested. Also, the KeyboardInterrupt approach is a hack. FAQ: How do I say unsigned char in

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread skip
Neil The colon's main purpose seems to be to allow one-liners: Neil Easy to parse: if a b: a += 1 Neil Hard to parse if a b a += 1 No, as the note from Tim Peters referenced by Robert Kern pointed out earlier in this thread, the ABC language designers found that indentation-based

Re: Back Slash not allowed at the end of raw string?

2006-11-10 Thread Peter Otten
yuhao wrote: I'm using Python 2.5 on Windows XP Pro. While testing for strings, I got the following result: r'c:\' SyntaxError: EOL while scanning single-quoted string what does this message mean? I'm not using any single quote in the statement. It this a bug or by design?

FAQ: How do I calculate what quoted strings and numbers mean?

2006-11-10 Thread p . lavarre
Subject: announce: FAQs suggested ... http://effbot.org/pyfaq/suggest.htm has new FAQ's ... FAQ: How do I calculate what quoted strings and numbers mean? A: eval(source, {'builtins': {}}) works, without also accidentally accepting OS commands as input. Note: Eval might surprise you if you

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Neil Cerutti
On 2006-11-09, Bjoern Schliessmann [EMAIL PROTECTED] wrote: What about 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. The disadvantage is that the usual binary logical operators must

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread skip
Neil The colon's main purpose seems to be to allow one-liners: Neil Easy to parse: if a b: a += 1 Neil Hard to parse if a b a += 1 Skip ... the ABC language designers found that indentation-based block Skip structure by itself wasn't enough to clue new users in about the

Re: announce: FAQs suggested

2006-11-10 Thread p . lavarre
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://starship.python.net/crew/theller/ctypes/reference.html

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:

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Nick Craig-Wood
Christophe [EMAIL PROTECTED] wrote: ( and I must admit one of the reasons I avoid wx if possible, is because I don't use Gnome under Linux and the look and feel of wx applications is really horrible under KDE ) If you install the QT theme for GTK it all starts to look a lot nicer Eg

manual eggs downloads?

2006-11-10 Thread Harry George
eggs are wonderful for no-hassle get-all-the-dependencies. However, they can trigger hands-off downloads from various sites. This is Bad News for corporate environments in which every download is carefully pre-approved. A tarball with a subdirectory of third_party packages is ok. A web page

Re: how is python not the same as java?

2006-11-10 Thread Jorge Vargas
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 interprets the code ... and what do you think

range syntax

2006-11-10 Thread Colin J. Williams
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. I've just come across the r_class in numpy which doesn't go that far but does provide a generalization of the

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread Dan Lenski
Eric Brunel wrote: On Thu, 09 Nov 2006 22:01:51 +0100, Dan Lenski [EMAIL PROTECTED] wrote: Tk 8.4 appears to use native Win32 widgets under Cygwin and native WinXP. It seems to depend on the widget type, and on what you call native... For example, tk menus are definitely the native ones;

Need help with Subversion bindings

2006-11-10 Thread paul . keating
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 Python, but the very clever SWIG stuff has

Re: How to choose the right GUI toolkit ?

2006-11-10 Thread vdicarlo
I highly recommend wxPython. It's very mature, full-featured, and portable, and fairly easy to learn as well. I am also a Python beginner thinking about what GUI toolkit to use, and the availability of a free video screencast series on installing and using wxpython at showmedo.com is making me

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

2006-11-10 Thread paul . keating
This doesn't answer your whole post because it asked a lot of questions. But as to finding out whether something is an instance of a class: class X(object): # ... defined as in your post x = X('Fred') x class X contains: type(x) is X True isinstance(x,X) True x.__class__.__name__ 'X'

Re: Newb: installing Jython on Windows XP ...

2006-11-10 Thread [EMAIL PROTECTED]
I haven't installed on cygwin or windows XP myself but you should be using java jython-21. Note that there are two class files jython-21.class and jython_21.class. Also make sure that the CLASSPATH includes the directory that has these two class files. Raghu. donkeyboy wrote: All, I'm having

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Bjoern Schliessmann
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. Python also supports it. The disadvantage is that the usual binary logical

path.py and directory naming: trailing slash automatic?

2006-11-10 Thread [EMAIL PROTECTED]
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 + file # should yield /some/dir/file I emailed the author of

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Robert Kern
[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! -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by

Re: Getting externally-facing IP address?

2006-11-10 Thread Tim Williams
On 10/11/06, Michael B. Trausch [EMAIL PROTECTED] wrote: 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

Re: Getting externally-facing IP address?

2006-11-10 Thread Tim Williams
On 10/11/06, Tim Williams [EMAIL PROTECTED] wrote: On 10/11/06, Michael B. Trausch [EMAIL PROTECTED] wrote: 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

Re: Py3K idea: why not drop the colon?

2006-11-10 Thread Tony Nelson
In article [EMAIL PROTECTED], Bjoern Schliessmann [EMAIL PROTECTED] 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 ==

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

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 that. Python also

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

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

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

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 test myattrib=5/

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

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 + file #

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

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

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 couldn't

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

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

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 ); but even

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

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 statement

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. Python also supports

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

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

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

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 XFalsetype 'list'listI 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

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 good

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 now, such a

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

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. In that case, how

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 its derivatives. That

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

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 development

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

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

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

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

  1   2   >