Re: Method overloading?

2007-02-15 Thread Troy Melhase
On 14 Feb 2007 20:54:31 -0800, placid <[EMAIL PROTECTED]> wrote: > class Test: > def __init__(self): > pass > > def puts(self, str): > print str > > def puts(self, str,str2): > print str,str2 you might look into the overloading module and its decorator. source

Re: how to store and still search special characters in Python and MySql

2007-02-15 Thread Justin Ezequiel
On Feb 12, 12:26 pm, "ronrsr" <[EMAIL PROTECTED]> wrote: > I have an MySQL database called zingers. The structure is: > > I am having trouble storing text, as typed in latter two fields. > Special characters and punctuation all seem not to be stored and > retrieved correctly. > > Special apostroph

Re: f---ing typechecking

2007-02-15 Thread BJörn Lindqvist
On 2/15/07, James Stroud <[EMAIL PROTECTED]> wrote: > I guess we differ on what is obvious. This seems obvious to me: > > [1] + (1,) => [1, 1] > (1,) + [1] => (1, 1) I agreed with you up to this point. But this seems more obvious to me: [1] + (1,) => [1, 1] (1,) + [1] => [1, 1] In other language

Re: c++ for python programmers

2007-02-15 Thread Anders Arnholm
Nicola Musatti <[EMAIL PROTECTED]> skriver: > On Feb 14, 2:41 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote: > [...] >> Don't forget the lack of standard garbage collection. > memory related problems. I'm aware that most is not the same as all, > but on the other hand garbage collection has it's probl

how do "real" python programmers work?

2007-02-15 Thread Tyrrell, Wendy
_ Wendy Tyrrell WRL Adviser Camden Education Business Partnership Children, Schools and Families London Borough of Camden The Medburn Centre 136 Chalton Street NW1 1RX Streetmap: http://www.streetmap.co.uk/streetmap.dll?G2M?X=529491&Y=183342&A=Y&Z=1 Phone: 020 7974 8249

Re: threading and multicores, pros and cons

2007-02-15 Thread Rhamphoryncus
On Feb 14, 4:30 pm, "MRAB" <[EMAIL PROTECTED]> wrote: > Hmm. I wonder whether it would be possible to have a pair of python > cores, one for single-threaded code (no locks necessary) and the other > for multi-threaded code. When the Python program went from single- > threaded to multi-threaded or m

ZSI + mod_python

2007-02-15 Thread exhuma.twn
Hi, I tried for the last 2 hours now to somehow grasp how to use ZSI over mod_python. It's nice that they have a code-example in the ZSI docs, but it's incomplete and you are left guessing. The ZSI docs I used as reference can be found on http:// pywebsvcs.sourceforge.net/zsi.html#SECTION00313000

Re: how do "real" python programmers work?

2007-02-15 Thread Tim Golden
Tyrrell, Wendy wrote: (Well, nothing) Was that all your question, Wendy, or did you accidentally hit the Send button too soon? You're welcome to ask here or on the tutor list http://mail.python.org/mailman/listinfo/tutor if you want to find out about Python. Or just look at the website: http

Re: ANN: py lib 0.9.0: py.test, distributed execution, microthreads ...

2007-02-15 Thread Robin Becker
holger krekel wrote: ... > * py.execnet: ad-hoc code distribution to SSH, Socket and local sub processes ... Good stuff, but my rather ancient win32 client could not work properly with SshGateway; I think plink might work. I hacked register.py so that the eventual command came ou

ANN: EasyDialogs for Windows version 46691.0

2007-02-15 Thread Jimmy Retzlaff
EasyDialogs for Windows is available at: http://www.averdevelopment.com/python/ EasyDialogs for Windows is a ctypes based emulation of the EasyDialogs module included in the Python distribution for Mac. It attempts to be as compatible as possible. Code using the Mac EasyDialogs module can often b

ANN: java2python 0.1

2007-02-15 Thread Troy Melhase
java2python - Java to Python Source Code Translator --- java2python 0.1 Released 14 February 2007 What is java2python? -- java2python is a simple but effective tool to trans

Re: Exception

2007-02-15 Thread Steve Holden
Navid Parvini wrote: > Dear All, > > Would you please tell me if there is a pysignal or method that called > when an exception is occurred? (I don't want to use "try" method) > No such method exists, and signals aren't used to generate exceptions. I'm afraid you want some other language, not

Re: c++ for python programmers

2007-02-15 Thread Steve Holden
Anders Arnholm wrote: > Sam <[EMAIL PROTECTED]> skriver: >> On 13 Feb 2007 17:51:00 GMT, Jorgen Grahn >> <[EMAIL PROTECTED]> wrote: >>> Well, C++ is a better language than C in many ways. So, if he needs to learn >>> one of them, why does it have to be C? >>> >>> Another reason some people choose C

Re: rot13 in a more Pythonic style?

2007-02-15 Thread Andy Dingley
On 14 Feb, 21:59, Paul Rubin wrote: > Why don't you describe the actual problem instead of the rot13 analogy. I don't know what the actual problem is! I need to perform a complex mapping between "old style" structured identifiers and "new style" structured identifers. A

Re: hi all

2007-02-15 Thread Steve Holden
Sandeep Patil , Bangalore wrote: > I get an error while I try to call python through VB. > > The error is “ Error 429: Active X cant create object” > > > > Pls anybody help me to call python through VB. > The problem is on line 23 of your code. Sorry, that was a rather flip way of saying tha

Re: threading and multicores, pros and cons

2007-02-15 Thread Paul Boddie
On 15 Feb, 00:14, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > Yeah, it's the Window equivalent to fork. Does true copy-on-write, so > you can do efficient multiprocess work. Aside from some code floating around the net which possibly originates from some book on Windows systems programming

Re: f---ing typechecking

2007-02-15 Thread Steve Holden
James Stroud wrote: > [EMAIL PROTECTED] wrote: >> Concatenating tuples and lists seems logical if you think of tuples as >> sequences. If you think of them more like Pascal records or C structs >> instead (I believe that's Guido's perspective on tuples) then it makes no >> sense at all. >> >> Skip

Re: Newbie Question

2007-02-15 Thread Steve Holden
Stef Mientki wrote: > [EMAIL PROTECTED] wrote: >> On 9 fév, 14:06, Stef Mientki <[EMAIL PROTECTED]> wrote: > will explain the rest Delphi is a (dying) proprietary, MS-Windows-only[1] software relying on a low-level language. >>> Well it may be dying, >>> but for the moment it beats Py

Re: f---ing typechecking

2007-02-15 Thread James Stroud
BJörn Lindqvist wrote: > On 2/15/07, James Stroud <[EMAIL PROTECTED]> wrote: >> I guess we differ on what is obvious. This seems obvious to me: >> >> [1] + (1,) => [1, 1] >> (1,) + [1] => (1, 1) > > I agreed with you up to this point. But this seems more obvious to me: > > [1] + (1,) => [1, 1] >

Re: f---ing typechecking

2007-02-15 Thread James Stroud
Steven D'Aprano wrote: > On Wed, 14 Feb 2007 22:21:43 -0800, James Stroud wrote: > >>> The user's expected behaviour for [1] + (1,) might be to return a list, or >>> it might be to return a tuple. Since there is no obviously correct >>> behaviour, the right thing to do is to refuse to guess. >> I

Re: pygame and python 2.5

2007-02-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Feb 13, 2:24 am, Steve Holden <[EMAIL PROTECTED]> wrote: [...] This wouldn't be a simple project, but since there's a Windows buildbot for Python there's no reason why the same couldn't be done for extensions. I'll raise this with the PSF and see what th

Re: f---ing typechecking

2007-02-15 Thread James Stroud
Paul McGuire wrote: > Since tuples are immutable, I think of them as fixed data objects with > some simple sequential structure, as opposed to lists which are much > more dynamically accessible/updateable data containers. Back in my > relational database design days, I sometimes had to create a pr

Re: How much memory used by a name

2007-02-15 Thread Fredrik Lundh
Bernard Lebel wrote: > Bruno: good question. We're talking about text files that can have > 300,000 lines, if not more. Currently, the way I have coded the file > writing, every line calls for a write() to the file object, which in > turns write to the text file. The file is on the network. assum

basic jython question

2007-02-15 Thread Gerard Flanagan
Hello all I have a 'logger' module which is essentially just a facade over the 'logging' standard module. Can this be called from jython, and how is this acheived? This is a colleague's question but I have no knowledge of jython or java, and I can't install them at present in order to figure it ou

Re: A problem of using pyfort

2007-02-15 Thread Diez B. Roggisch
> > I didn't find any solutions via internet. So I really > need your help. The OS on my computer is Fedora Core 5. Thanks in > advance. Really? Entering the error-message and fedora core 5 brings this up as first result in google: http://www.bo.infn.it/alice/alice-doc/mll-doc/ali-inst/node40.ht

Re: basic jython question

2007-02-15 Thread Richard Brodie
"Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a 'logger' module which is essentially just a facade over the > 'logging' standard module. Can this be called from jython, and how is > this acheived? This is a colleague's question but I have no knowledge > o

Re: Method overloading?

2007-02-15 Thread [EMAIL PROTECTED]
On 15 fév, 09:32, "Troy Melhase" <[EMAIL PROTECTED]> wrote: > On 14 Feb 2007 20:54:31 -0800, placid <[EMAIL PROTECTED]> wrote: > > > class Test: > > def __init__(self): > > pass > > > def puts(self, str): > > print str > > > def puts(self, str,str2): > > print st

Re: AUX File Writing Error

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 03:34:59 -0300, John Machin <[EMAIL PROTECTED]> escribió: > On Feb 15, 4:03 pm, [EMAIL PROTECTED] wrote: >> Is there any way I can create an "AUX.csv" file without the error? > > Probably not. AUX, CON, NUL, PRN, LPT, COM1, COM2 etc (with or without > an extension) are reserv

Re: AUX File Writing Error

2007-02-15 Thread Steve Holden
Gabriel Genellina wrote: > En Thu, 15 Feb 2007 03:34:59 -0300, John Machin <[EMAIL PROTECTED]> > escribió: > >> On Feb 15, 4:03 pm, [EMAIL PROTECTED] wrote: >>> Is there any way I can create an "AUX.csv" file without the error? >> Probably not. AUX, CON, NUL, PRN, LPT, COM1, COM2 etc (with or wi

Re: How much memory used by a name

2007-02-15 Thread Bart Ogryczak
On Feb 14, 9:41 pm, "Bernard Lebel" <[EMAIL PROTECTED]> wrote: > This is taking a long time, and I'm looking for ways to speed up this > process. I though that keeping the list in memory and dropping to the > file at the very end could be a possible approach. It seems, that you're trying to reinve

Re: basic jython question

2007-02-15 Thread Gerard Flanagan
On Feb 15, 1:53 pm, "Richard Brodie" <[EMAIL PROTECTED]> wrote: > "Gerard Flanagan" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > I have a 'logger' module which is essentially just a facade over the > > 'logging' standard module. Can this be called from jython, and how is >

Re: list of range of floats

2007-02-15 Thread Bart Ogryczak
On Feb 14, 6:12 pm, Steve <[EMAIL PROTECTED]> wrote: > I'm trying to create a list range of floats and running into problems. I've tried it the easy way. Works. map(float,range(a,b)) -- http://mail.python.org/mailman/listinfo/python-list

Re: AUX File Writing Error

2007-02-15 Thread John Machin
On Feb 16, 12:13 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 15 Feb 2007 03:34:59 -0300, John Machin <[EMAIL PROTECTED]> > escribió: > > > On Feb 15, 4:03 pm, [EMAIL PROTECTED] wrote: > >> Is there any way I can create an "AUX.csv" file without the error? > > > Probably not. AUX, C

Re: AUX File Writing Error

2007-02-15 Thread Jean-Paul Calderone
On Thu, 15 Feb 2007 10:13:17 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >En Thu, 15 Feb 2007 03:34:59 -0300, John Machin <[EMAIL PROTECTED]> >escribió: > >> On Feb 15, 4:03 pm, [EMAIL PROTECTED] wrote: >>> Is there any way I can create an "AUX.csv" file without the error? >> >> Probably no

Re: f---ing typechecking

2007-02-15 Thread Marc
On 15 feb, 07:21, James Stroud <[EMAIL PROTECTED]> wrote: > I guess we differ on what is obvious. This seems obvious to me: > > [1] + (1,) => [1, 1] > (1,) + [1] => (1, 1) > > simply becuase the operand on the left should take precendence because > its "__add__" is called and its "__add__" returns

Re: AUX File Writing Error

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 11:34:53 -0300, John Machin <[EMAIL PROTECTED]> escribió: >> > Probably not. AUX, CON, NUL, PRN, LPT, COM1, COM2 etc (with or without >> > an extension) are reserved in Windows for specific devices for >> > compatibility with MS-DOS 1.00 programs, which did that for >> > comp

list of strings-newline

2007-02-15 Thread kavitha thankaian
Hi i have a list as follows list="a1,b1,c1,d1,a2,b2,c2,d2,a3,b3,c3,d3, I would like to print as a1,b1,c1,d1, a2,b2,c2,d2, a3,b3,c3,d3, and then i would like to delete the comma at the end,,say like,, a1,b1,c1,d1 a2,b2,c2,d2 a3,b3,c3,d3 (its always

Re: builtin set literal

2007-02-15 Thread Steven Bethard
Schüle Daniel wrote: > Hello, > > lst = list((1,2,3)) > lst = [1,2,3] > > t = tupel((1,2,3)) > t = (1,2,3) > > s = set((1,2,3)) > s = ... > > it would be nice feature to have builtin literal for set type > maybe in P3 .. what about? > s = <1,2,3> In Python 3.0, this looks like:: s = {1,2

Re: threading and multicores, pros and cons

2007-02-15 Thread skip
Maric> Le mercredi 14 février 2007 16:24, [EMAIL PROTECTED] a écrit : >> "Some time back, a group did remove the GIL from the python core, and >> implemented locks on the core code to make it threadsafe. Well, the >> problem was that while it worked, the necessary locks it made sin

Re: f---ing typechecking

2007-02-15 Thread skip
Sergey> posix.stat_result is CLASS, not regular tuple. I believe it morphed from being a tuple though. I wasn't suggesting that there is some other way to approximate records. I was trying to demonstrate the use of a tuple as a record. It eventually became so compelling that a new struct_t

Re: Method overloading?

2007-02-15 Thread Grant Edwards
On 2007-02-15, placid <[EMAIL PROTECTED]> wrote: >> > Is it possible to be able to do the following in Python? >> >> > class Test: >> > def __init__(self): >> > pass >> >> > def puts(self, str): >> > print str >> >> > def puts(self, str,str2): >> > print str,str

Re: output to console and to multiple files

2007-02-15 Thread [EMAIL PROTECTED]
On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote: > like this? > > class Writers (object): > > def __init__(self, *writers): > self.writers = writers > > def write(self, string): > for w in self.writers: > w.write(string) > > def flush(self): >

filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
Hello! I have a question about filecmp.cmp(). The short code snippet blow does not bahave as I would expect: import filecmp f0 = "foo.dat" f1 = "bar.dat" f = open(f0, "w") f.write("1:2") f.close() f = open(f1, "w") f.write("1:2") f.close() print "cmp 1: " + str(filecmp.cmp(f0, f1, False)) f

Re: rot13 in a more Pythonic style?

2007-02-15 Thread [EMAIL PROTECTED]
On Feb 14, 11:46 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 14 Feb 2007 14:04:17 -0300, Andy Dingley <[EMAIL PROTECTED]> > escribió: > > > I still don't understand what a lambda is _for_ in Python. I know what > > they are, I know what the alternatives are, but I still haven't fou

Re: output to console and to multiple files

2007-02-15 Thread [EMAIL PROTECTED]
On Feb 14, 6:52 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 14 Feb 2007 19:28:34 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribió: > > > I'm looking for a way to output stdout/stderr (from a subprocess or > > spawn) to screen and to at least two different files. > > Look at

The Python interactive interpreter has no command history

2007-02-15 Thread ThomasC
Hello, How to configure Python2.5's interactive interpreter to get command history ? I always got ^[[A and ^[[B . Thank you !! Thomas# -- http://mail.python.org/mailman/listinfo/python-list

Re: f---ing typechecking

2007-02-15 Thread Neil Cerutti
On 2007-02-14, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > Szabolcs Nagy wrote: > L=[1] > L.extend((1,)) > L >> [1, 1] > > Are list.extend() and list concatenation supposed to behave > differently? I always thought concatenation was just shorthand > for calling extend(). They are dif

Re: f---ing typechecking

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Paul McGuire <[EMAIL PROTECTED]> wrote: > Since tuples are immutable, I think of them as fixed data objects with > some simple sequential structure, as opposed to lists which are much > more dynamically accessible/updateable data containers. Me, too. There are plenty of things tha

Re: Method overloading?

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> def multiAccept( argOfVariousTypes ): >> if isinstance(argOfVariousTypes,int): >> # treat like an int >> elif isinstance(argOfVariousTypes,float): >> # treat like a float >> elif isinstance(argOfVariousTypes,(l

Re: Recursive calls and stack

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Wed, 14 Feb 2007 10:41:53 -0300, Neil Cerutti <[EMAIL PROTECTED]> > escribió: >> So the effect is that mutual recursion isn't actually any >> harder. > > But some kind of language support is required in this case. At > least I don'

Re: output to console and to multiple files

2007-02-15 Thread Matimus
On Feb 15, 7:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote: > > > > > like this? > > > class Writers (object): > > > def __init__(self, *writers): > > self.writers = writers > > > def write(self, string): > >

Re: filecmp.cmp() cache

2007-02-15 Thread Peter Otten
Mattias Brändström wrote: > I have a question about filecmp.cmp(). The short code snippet blow > does not bahave as I would expect: > > import filecmp > > f0 = "foo.dat" > f1 = "bar.dat" > > f = open(f0, "w") > f.write("1:2") > f.close() > > f = open(f1, "w") > f.write("1:2") > f.close() > >

Re: multiple inheritance of a dynamic list of classes?

2007-02-15 Thread Michele Simionato
On Feb 13, 9:14 am, Peter Otten <[EMAIL PROTECTED]> wrote: > "Avoid inheritance" would be almost as justified :-) Yep, I strongly agree. Inheritance is overrated, as Guido says. For what concerns the debate of multiple vs single inheritance, yes it is true that multiple inheritance is worse, but e

re.search making no match == 0

2007-02-15 Thread Lance Hoffmeyer
Hey all, I have a search: VAR = re.search("PROVEN.*?\n[\sA-Za-z\(\)\/\-]+\d(.*?)\n.*?" , pcpT9, re.S ).group(1) #.split()[1] that does not match (sometimes it will and sometimes it will not match) Traceback (most recent call last): File "P:\Burke\TRACKERS\Ortho-McNeil\Automation\Wave3\test.

Re: multiple inheritance of a dynamic list of classes?

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Feb 13, 9:14 am, Peter Otten <[EMAIL PROTECTED]> wrote: >> "Avoid inheritance" would be almost as justified :-) > > In other words, if you are inheriting just two or three methods > it may works, but when you start having dozens of me

Re: The Python interactive interpreter has no command history

2007-02-15 Thread Eduardo \"EdCrypt\" O. Padoan
> Hello, > > How to configure Python2.5's interactive interpreter to get command > history ? > > I always got ^[[A and ^[[B . > Are you using Ubuntu? The last comes with 2.4.x and 2.5. This only occurs on 2.5. This happens when you compile Python with libreadline installed, AFAIK. FIll a bug in th

Re: The Python interactive interpreter has no command history

2007-02-15 Thread Laurent Rahuel
Hi, You need to have readline installed. Laurent ThomasC wrote: > Hello, > > How to configure Python2.5's interactive interpreter to get command > history ? > > I always got ^[[A and ^[[B . > > Thank you !! > > Thomas# -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin set literal

2007-02-15 Thread Schüle Daniel
faulkner schrieb: > On Feb 14, 11:55 am, Schüle Daniel <[EMAIL PROTECTED]> wrote: >> Hello, >> >> lst = list((1,2,3)) >> lst = [1,2,3] >> >> t = tupel((1,2,3)) >> t = (1,2,3) >> >> s = set((1,2,3)) >> s = ... >> >> it would be nice feature to have builtin literal for set type >> maybe in P3 .. what

Re: builtin set literal

2007-02-15 Thread Schüle Daniel
Steven Bethard schrieb: > Schüle Daniel wrote: >> Hello, >> >> lst = list((1,2,3)) >> lst = [1,2,3] >> >> t = tupel((1,2,3)) >> t = (1,2,3) >> >> s = set((1,2,3)) >> s = ... >> >> it would be nice feature to have builtin literal for set type >> maybe in P3 .. what about? >> s = <1,2,3> > > In Pyth

Re: How to write a programe that include both pipe(low speed system call) and signal

2007-02-15 Thread Jordan
On Feb 15, 2:51 am, Marco <[EMAIL PROTECTED]> wrote: > Hi, > I have know that signal will interrupt some kind low speed system > call like pipe. But how to design a program that both support signal > and pipe? > > I have a mplayer.py to play movie via os.popen2() and mplayer > slave mode. A

Re: list of range of floats

2007-02-15 Thread Steve
On Thu, 15 Feb 2007 05:57:45 -0800, Bart Ogryczak wrote: > On Feb 14, 6:12 pm, Steve <[EMAIL PROTECTED]> wrote: >> I'm trying to create a list range of floats and running into problems. > > I've tried it the easy way. Works. > map(float,range(a,b)) Thanks Bart, I'll give it a try Steve -- htt

Re: re.search making no match == 0

2007-02-15 Thread Peter Otten
Lance Hoffmeyer wrote: > I have a search: > > VAR = re.search("PROVEN.*?\n[\sA-Za-z\(\)\/\-]+\d(.*?)\n.*?" , pcpT9, re.S > ).group(1) #.split()[1] > > that does not match (sometimes it will and sometimes it will not match) > > Traceback (most recent call last): > File "P:\Burke\TRACKERS\Orth

TKinter newbie

2007-02-15 Thread Gigs_
Hi Im new to gui programming from Tkinter import * # get widget classes from tkMessageBox import askokcancel # get canned std dialog class Quitter(Frame): # subclass our GUI def __init__(self, parent=None): # constructor m

Which Object Database would you recommend for cross platform application?

2007-02-15 Thread Thomas Ploch
Hello folks, I am currently developing an open source Event Managment software (events in real-life, like concerts, exhibitions etc. :-) ) using wx for the GUI, and I need an Object database. Since this is the first time I actually need doing this, I wondered if anybody here could recommend on

Re: Which Object Database would you recommend for cross platform application?

2007-02-15 Thread johnf
Thomas Ploch wrote: > Hello folks, > > I am currently developing an open source Event Managment software > (events in real-life, like concerts, exhibitions etc. :-) ) using wx for > the GUI, and I need an Object database. Since this is the first time I > actually need doing this, I wondered if an

Re: TKinter newbie

2007-02-15 Thread Peter Otten
Gigs_ wrote: > Hi Im new to gui programming > > from Tkinter import * # get widget classes > from tkMessageBox import askokcancel # get canned std dialog > > class Quitter(Frame): # subclass our GUI > def __init__(self, parent=None

Re: TKinter newbie

2007-02-15 Thread Steve Holden
Gigs_ wrote: > Hi Im new to gui programming > > from Tkinter import * # get widget classes > from tkMessageBox import askokcancel # get canned std dialog > > class Quitter(Frame): # subclass our GUI > def __init__(self, parent=None)

Re: Recursive calls and stack

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 13:37:19 -0300, Neil Cerutti <[EMAIL PROTECTED]> escribió: > On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> En Wed, 14 Feb 2007 10:41:53 -0300, Neil Cerutti <[EMAIL PROTECTED]> >> escribió: >>> So the effect is that mutual recursion isn't actually any >>> hard

Re: SystemError: _PyImport_FixupExtension: module _types not loaded

2007-02-15 Thread usenet1
On Feb 12, 2:25 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 12 Feb 2007 15:44:36 -0300, <[EMAIL PROTECTED]> escribió: > > > I'm trying to write some "C" code that will run a python script that > > can in turn call some "C" functions. However I'm having a problem > > getting starte

RE engines and related matters

2007-02-15 Thread bearophileHUGS
>From Lambda the Ultimate blog, a link to an interesting article about such topics: http://swtch.com/~rsc/regexp/regexp1.html http://swtch.com/~rsc/regexp/ http://lambda-the-ultimate.org/node/2064 Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: rot13 in a more Pythonic style?

2007-02-15 Thread Andy Dingley
On 15 Feb, 17:55, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > Sounds more like a case for a parser/lexer wherein the emitted "code > tokens" are the "new style" identifiers... 8-(I'm trying not to think about that Fortunately I don't think it's _quite_ that bad. -- http://ma

Re: SystemError: _PyImport_FixupExtension: module _types not loaded

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 15:42:51 -0300, <[EMAIL PROTECTED]> escribió: > This is what I get: > > 'import site' failed; use -v for traceback > ['c:\\temp\\pytest\\Debug\\python25_d.zip', 'C:\\Python25\\Lib', 'C:\ > \Python25\\DLLs', 'C:\\Python25\\Lib\\lib-tk', '', 'c:\\temp\\pytest\ > \Debug'] > > In f

Re: reference data in a dictionary

2007-02-15 Thread Duncan Booth
"Wensui Liu" <[EMAIL PROTECTED]> wrote: > I know dict['row1'] will always work. but it will only get 1 row out > of the dict. is there anyway i can get multiple (>1) rows out of dict > by directly refeencing them, something like dict[['row1', 'row2']]. > [d[x] for x in ('row1', 'row2')] -- http:

Re: f---ing typechecking

2007-02-15 Thread Ben Finney
James Stroud <[EMAIL PROTECTED]> writes: > I increasingly come to the decision to avoid tuples altogether > because, eventually, you end up turning them into lists anyway I don't. I end up extracting them to separate variables. >>> foo = (12, None, "spam") >>> # ... >>> # much code,

Re: Recursive calls and stack

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 15 Feb 2007 13:37:19 -0300, Neil Cerutti <[EMAIL PROTECTED]> > escribió: > >> On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>> En Wed, 14 Feb 2007 10:41:53 -0300, Neil Cerutti <[EMAIL PROTECTED]> >>> escribió: >>

Re: Which Object Database would you recommend for cross platform application?

2007-02-15 Thread Bruno Desthuilliers
Thomas Ploch a écrit : > Hello folks, > > I am currently developing an open source Event Managment software > (events in real-life, like concerts, exhibitions etc. :-) ) using wx for > the GUI, and I need an Object database. "need" ? Why ? (I don't mean you shouldn't use one, just questionning

Re: Recursive calls and stack

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 16:35:25 -0300, Neil Cerutti <[EMAIL PROTECTED]> escribió: > On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> En Thu, 15 Feb 2007 13:37:19 -0300, Neil Cerutti <[EMAIL PROTECTED]> >> escribió: >> >>> On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >>>

Python code to do the *server* side of digest authentication?

2007-02-15 Thread Dan Lenski
Hi all, I've got a very simple HTML proxy server to access the web from my cell phone (based on this code: http://www.okisoft.co.jp/esc/python/proxy/). It's a very retarded phone that freezes if there's no Content-Length header and some other circumstances, so I have to tweak and modify the headers

Re: Python code to do the *server* side of digest authentication?

2007-02-15 Thread Larry Bates
Dan Lenski wrote: > Hi all, > I've got a very simple HTML proxy server to access the web from my > cell phone (based on this code: http://www.okisoft.co.jp/esc/python/proxy/). > It's a very retarded phone that freezes if there's no Content-Length > header and some other circumstances, so I have to

Re: SystemError: _PyImport_FixupExtension: module _types not loaded

2007-02-15 Thread usenet1
> "works" in the sense that it prints something; but sys.path is incomplete, > it lacks site-packages and others (they are added by site.py). > It appears that you have installed Python on C:\Python25 and you build > your application executable into c:\temp\pytest\Debug - is that true? > Hmmm,

Re: Recursive calls and stack

2007-02-15 Thread Neil Cerutti
On 2007-02-15, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> I'm not sure what you mean. The above support is enough for >> tail recursion, mutual recursion, and any other tail call to >> be "optimized." > > I only want to say that tail *recursion* can be eliminated > trivially transforming the

Re: f---ing typechecking

2007-02-15 Thread skip
Sergey> posix.stat_result is CLASS, not regular tuple. >> I believe it morphed from being a tuple though. I wasn't suggesting >> that Sergey> It it morphed, the tuple nature of it is just history now. No, it is still full of tuple-fu: >>> import os >>> s = os.stat("/et

Re: Python code to do the *server* side of digest authentication?

2007-02-15 Thread Dan Lenski
On Feb 15, 3:19 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > I think that is because normally the web server does the authentication on the > server side. Why not use Apache to do the digest authentication? > > http://httpd.apache.org/docs/2.0/mod/mod_auth_digest.html > > -Larry Hi Larry, I'm so

Re: builtin set literal

2007-02-15 Thread Steven Bethard
Schüle Daniel wrote: > Steven Bethard schrieb: >> Schüle Daniel wrote: >>> it would be nice feature to have builtin literal for set type >>> maybe in P3 .. what about? >>> s = <1,2,3> >> >> In Python 3.0, this looks like:: >> >> s = {1,2,3} > > jepp, that looks not bad .. as in a mathe book. >

Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of this pep would be to make it impossible to use the name 'print' in a backward compatible manner. Indeed, i

Re: f---ing typechecking

2007-02-15 Thread Paul Rubin
[EMAIL PROTECTED] writes: > My original comment was that tuples could be thought of more like > C structs or Pascal records. Should f(*args) receive a list rather than a tuple arg? -- http://mail.python.org/mailman/listinfo/python-list

Automated resizing of JPEG image + making slices?

2007-02-15 Thread Michiel Sikma
Hello everybody. I'm currently involved in a site building project in which we're going to use the Google Maps API. The user will be able to browse the site by looking over a really large image, similar to how Google Maps itself works, except with the design of the site on the background r

ANNOUNCE: Mod_python 3.3.1

2007-02-15 Thread Gregory (Grisha) Trubetskoy
The Apache Software Foundation and The Apache HTTP Server Project are pleased to announce the 3.3.1 release of mod_python. Mod_python 3.3.1 is considered a stable release, suitable for production use. Mod_python is an Apache HTTP Server module that embeds the Python language interpreter within th

Re: filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > You can clear the cache with > > filecmp._cache = {} > > as a glance into the filecmp module would have shown. You are right, a quick glance would have enlighten me. Next time I will RTFS first. :-) > If you don't want to use the cache

Re: Automated resizing of JPEG image + making slices?

2007-02-15 Thread Steve Holden
Michiel Sikma wrote: > Hello everybody. > > I'm currently involved in a site building project in which we're > going to use the Google Maps API. The user will be able to browse the > site by looking over a really large image, similar to how Google Maps > itself works, except with the design

Re: Pep 3105: the end of print?

2007-02-15 Thread Steven Bethard
Edward K Ream wrote: > The pros and cons of making 'print' a function in Python 3.x are well > discussed at: > > http://mail.python.org/pipermail/python-dev/2005-September/056154.html > > Alas, it appears that the effect of this pep would be to make it impossible > to use the name 'print' in a ba

Re: Automated resizing of JPEG image + making slices?

2007-02-15 Thread Paul Rubin
Michiel Sikma <[EMAIL PROTECTED]> writes: > I know some Python (but not much since I've never actually written > that many things in it), and with some effort I could probably make a > simple image manipulator frontend in it, but only if I can find a > good library for doing the actual manipulation

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
> You could offer up a patch for Python 2.6 so that you can do:: >from __future__ import print_function This would only work for Python 2.6. Developers might want to support Python 2.3 through 2.5 for awhile longer :-) > why can't you use ``file.write()`` instead of ``print``? Precisely my

Re: output to console and to multiple files

2007-02-15 Thread Matimus
On Feb 15, 8:51 am, "Matimus" <[EMAIL PROTECTED]> wrote: > On Feb 15, 7:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > wrote: > > > > > On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote: > > > > like this? > > > > class Writers (object): > > > > def __init__(self, *writers): > > >

Re: filecmp.cmp() cache

2007-02-15 Thread Peter Otten
Mattias Brändström wrote: > On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >> You can clear the cache with >> >> filecmp._cache = {} >> >> as a glance into the filecmp module would have shown. > > You are right, a quick glance would have enlighten me. Next time I > will RTFS first. :-

Re: Automated resizing of JPEG image + making slices?

2007-02-15 Thread Chuck Rhode
Michiel Sikma wrote this on Thu, 15 Feb 2007 22:21:34 +0100. My reply is below. -snip- > I initially hired someone to do it in PHP (don't bite, please :-) > but it seems that I forgot about one thing: the people updating the > site would have been able to upload a huge 30 MB JPEG image, which >

Re: filecmp.cmp() cache

2007-02-15 Thread Mattias Brändström
On Feb 15, 11:43 pm, Peter Otten <[EMAIL PROTECTED]> wrote: > Mattias Brändström wrote: > > Just one small tought/question. How likely am I to run into trouble > > because of this? I mean, by setting _cache to another value I'm > > mucking about in filecmp's implementation details. Is this generall

Re: Pep 3105: the end of print?

2007-02-15 Thread massimo s.
Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* be not backwards-compatible with previous releases? m. -- http://mail.python.org/mailman/listinfo/python-list

Tkinter __call__

2007-02-15 Thread Gigs_
from Tkinter import * from tkFileDialog import askopenfilename from tkColorChooser import askcolor from tkMessageBox import askquestion, showerror from tkSimpleDialog import askfloat demos = { 'Open': askopenfilename, 'Color': askcolor, 'Query': lambda: askquestion('Warning', '

Re: f---ing typechecking

2007-02-15 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > My original comment was that tuples could be thought of more like > > C structs or Pascal records. > > Should f(*args) receive a list rather than a tuple arg? No, clearly not. Function

  1   2   >