Re: Need an identity operator because lambda is too slow

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 21:59:18 -0800, Deron Meranda wrote: > Consider a much-simplified example of such an iteration where > sometimes you need to transform an item by some function, but most of > the time you don't: > > if some_rare_condition: > func = some_transform_function > els

Re: Getting a class name

2007-02-17 Thread goodwolf
I suppose that you wont get class name into its code (or before definition end) but not into a method definition. import sys def getCodeName(deap=0): return sys._getframe(deap+1).f_code.co_name class MyClass (object): name = getCodeName() + '!' -- http://mail.python.org/mailman/list

Re: Help Parsing XML Namespaces with BeautifulSoup

2007-02-17 Thread Paul McGuire
On Feb 17, 6:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I'm trying to parse out some XML nodes with namespaces using > BeautifulSoup. I can't seem to get the syntax correct. It doesn't like > the colon in the tag name, and I'm not sure how to refer to that tag. > > I'm trying to get th

conver string to dictionary

2007-02-17 Thread mahdieh saeed
Hi I want to convert string to dictionary .what is the best solution for this ? for example string is like this: '{"SalutationID":["primarykey",8388607,0,None],"CompanyID":[0,8388607,0,"index"], "SalutationName":["",255,0,None],"isDefault":["tinyint",1,1,None]}' and I want to conv

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 17:10:50 -0800, google wrote: > I just included file opening code just to show how i read the file > into the text buffer - I have no issues with this as such. Problem is > only with the writing of the text buffer back to a file. When I try to > write the buffer to a file it ga

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 17:19:06 -0800, google wrote: >> Did you get an exception? Maybe something about not being able to open >> the file for reading? Or perhaps disk full? > > File read ok for input, its the file write thats the problem Well, duh. I know that -- that's what your first email said.

Re: Need an identity operator because lambda is too slow

2007-02-17 Thread Raymond Hettinger
[Deron Meranda >] I'm looking for something in > Python which would act like an identity operator, or I-combinator: a > do-nothing function. The best I know of is: (lambda x: x), but it is > not ideal. File a feature request on SourceForge and assign to me. This has come up a couple of times a

Re: Need an identity operator because lambda is too slow

2007-02-17 Thread Paul Rubin
"Deron Meranda" <[EMAIL PROTECTED]> writes: > do_transform = some_rare_condition > for item in some_sequence: > if do_transform: > item2 = transform_function(item) > else: > item2 = item > . # more stuff This might be a little more direct

Need an identity operator because lambda is too slow

2007-02-17 Thread Deron Meranda
This is an optimization problem, one that occurs deep inside a loop that gets executed thousands of times. I'm looking for something in Python which would act like an identity operator, or I-combinator: a do-nothing function. The best I know of is: (lambda x: x), but it is not ideal. Consider a

PyDev on Mac

2007-02-17 Thread Ahmer
I've been trying to set up PyDev on my new MacBook Pro, but i have not had an success. Could you please help! -- http://mail.python.org/mailman/listinfo/python-list

Game Programming Clinic and Online Gaming at PyCon

2007-02-17 Thread Jeff Rush
At PyCon this year we're going to have a multi-day game programming clinic and challenge. This is a first-time event and an experiment to find those in the Python community who enjoy playing and creating games. Python has several powerful modules for the creation of games among which are PyGam

Re: How do I save the contents of a text buffer

2007-02-17 Thread google
On Feb 18, 1:14 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sat, 17 Feb 2007 15:47:20 -0800, google wrote: > > As a test, I tried to write the buffer back to a file with this code > > but did not work, > > Oooh, guessing games! I love guessing games! Good > Let me see... did it reboot you

Re: How do I save the contents of a text buffer

2007-02-17 Thread google
I just included file opening code just to show how i read the file into the text buffer - I have no issues with this as such. Problem is only with the writing of the text buffer back to a file. When I try to write the buffer to a file it gave the following, Traceback (most recent call last): Fi

Help Parsing XML Namespaces with BeautifulSoup

2007-02-17 Thread [EMAIL PROTECTED]
I'm trying to parse out some XML nodes with namespaces using BeautifulSoup. I can't seem to get the syntax correct. It doesn't like the colon in the tag name, and I'm not sure how to refer to that tag. I'm trying to get the attributes of this tag: The only way I've been able to get it is by doi

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Gabriel Genellina
En Sat, 17 Feb 2007 21:12:07 -0300, Stef Mientki <[EMAIL PROTECTED]> escribió: >> I would love to see: >> - a comparison between wx and gtk (QT doesn't have a very inviting >> license ;-) > I just found this: > http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits But ke

Re: How do I save the contents of a text buffer

2007-02-17 Thread Gabriel Genellina
En Sat, 17 Feb 2007 20:47:20 -0300, <[EMAIL PROTECTED]> escribió: > I'm using Python with pygtk and have this problem - I have read the > contents of a file into the text buffer with this code, > > infile = open("mytextfile", "r") > if infile: > string = infile.read() >

Re: How do I save the contents of a text buffer

2007-02-17 Thread Steven D'Aprano
On Sat, 17 Feb 2007 15:47:20 -0800, google wrote: > As a test, I tried to write the buffer back to a file with this code > but did not work, Oooh, guessing games! I love guessing games! Let me see... did it reboot your PC? Did Python crash? Did you get an exception? Maybe something about not b

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Stef Mientki
> I would love to see: > - a comparison between wx and gtk (QT doesn't have a very inviting > license ;-) I just found this: http://www.wxwidgets.org/wiki/index.php/WxWidgets_Compared_To_Other_Toolkits -- http://mail.python.org/mailman/listinfo/python-list

'import dl' on AMD64 platform

2007-02-17 Thread John Pye
Hi all I have a tricky situation that's preventing my Python/SWIG/C application from running on the Debian Etch AMD64 platform. It seems that the 'dl' module is not available on that platform. The only reason I need the 'dl' module, however, is for the values of RTLD_LAZY etc, which I use with sy

Re: message processing/threads

2007-02-17 Thread Irmen de Jong
Jonathan Curran wrote: > I need a program running in the background to process messages (FIFO order) > which I would send using soap/xmlrpc/pyro (haven't decided yet). According to > my thinking I would need to make this a threaded application. One thread to > process the messages and the other

How do I save the contents of a text buffer

2007-02-17 Thread google
Hi, I'm using Python with pygtk and have this problem - I have read the contents of a file into the text buffer with this code, infile = open("mytextfile", "r") if infile: string = infile.read() infile.close() textbuffer.set_text(string) As a t

Re: WHAT IS THIS?

2007-02-17 Thread Captain
Thanks for the responses. I'll just leave it. Sorry about uppercase subject line. "Captain" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just bought a new PC with Windows XP Media Edition. I have two entries in > the "Add or Remove Programs" section of Control Panel, but there

Re: Complex HTML forms

2007-02-17 Thread Paul Boddie
George Sakkis wrote: > When the form is submitted, the selected options are passed in the server in > some form > that preserves the hierarchy, i.e. not as a flat dict. Is there anything > close to such a beast around ? Yes, I have a framework called XSLForms which generates hierarchical field n

Re: how to use Dispatch to open an application in win32com.client

2007-02-17 Thread Gabriel Genellina
En Sat, 17 Feb 2007 17:47:23 -0300, vithi <[EMAIL PROTECTED]> escribió: > Hi > Since I haven't see any help or tutorial on com there is a application > is installed in the server I am login to the server then what code do > I have to implement to launch the application registered in a server. > ho

Re: cmd all commands method?

2007-02-17 Thread Bjoern Schliessmann
placid wrote: > if i want to treat every cmdloop prompt entry as a potential > command then i need to overwrite the default() method ? Excuse me, what's a cmdloop prompt? What's the "default() method"? > What i want to achieve is to be able to support global variable > creation for example; >

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Stef Mientki
>> - designing the GUI will cost me about 2 .. 3 times as much in Python > > You mean delphi here I presume? No, but if that's your believe .. Some examples: - Creating a treeview (like in the M$ explorer), with full edit capabilities and full drag & drop facilities: Delphi takes about 40 lines o

Mensaje Eliminado por contener virus

2007-02-17 Thread Correo Ejercito Nacional de Colombia
Este es un aviso del servicio de ANTIVIRUS DEL EJERCITO NACIONAL DE COLOMBIA, informando que el mensaje (e-mail) adjunto, fue eliminado por contener algun clase de virus. Cualquier inquietud por favor contactar el ÁREA DE SEGURIDAD INFORMATICA DEL EJERCITO. Email: [EMAIL PROTECTED]--- Begin Mes

Complex HTML forms

2007-02-17 Thread George Sakkis
I'd like to gather advice and links to any existing solutions (e.g. libraries, frameworks, design patterns) on general ways of writing complex web forms, as opposed to the typical {name:value} flat model. A particular case of what I mean by complex is hierarchical forms. For instance, a form that c

Re: message processing/threads

2007-02-17 Thread fumanchu
On Feb 11, 9:30 pm, Jonathan Curran <[EMAIL PROTECTED]> wrote: > I need a program running in the background to process > messages (FIFO order) which I would send using > soap/xmlrpc/pyro (haven't decided yet). According to > my thinking I would need to make this a threaded > application. One thread

Re: message processing/threads

2007-02-17 Thread Aahz
In article <[EMAIL PROTECTED]>, Jonathan Curran <[EMAIL PROTECTED]> wrote: > >I need a program running in the background to process messages (FIFO order) >which I would send using soap/xmlrpc/pyro (haven't decided yet). According to >my thinking I would need to make this a threaded application.

Re: how to use Dispatch to open an application in win32com.client

2007-02-17 Thread vithi
Hi Since I haven't see any help or tutorial on com there is a application is installed in the server I am login to the server then what code do I have to implement to launch the application registered in a server. how do I write a code to tell my computer to go in to the perticular server and launc

Re: Approaches of interprocess communication

2007-02-17 Thread Damjan
> | > If a programmer decides on behalf of the user that "localhost" should > | > be treated specially, that programmer is making an error. > | > | Inter-process TCP/IP communication between two processes on the same > | host invariably uses the loopback interface (network 127.0.0.0). > | According

Re: Getting a class name

2007-02-17 Thread deelan
Harlin Seritt wrote: > Hi, > > How does one get the name of a class from within the class code? I > tried something like this as a guess: > > self.__name__ Get the class first, then inspect its name: >>> class Foo(object): pass ... >>> f = Foo() >>> f.__class__.__name__ 'Foo' >>> HTH --

Getting a class name

2007-02-17 Thread Harlin Seritt
Hi, How does one get the name of a class from within the class code? I tried something like this as a guess: self.__name__ Obviously it didn't work. Anyone know how to do that? Thanks, Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: why I don't like range/xrange

2007-02-17 Thread [EMAIL PROTECTED]
Bruno Desthuilliers wrote: > Roel Schroeven a ecrit : > > Bruno Desthuilliers schreef: > > > >> stdazi a ecrit : > > > > > >>> for (i = 0 ; i < 10 ; i++) > >>>i = 10; > >> > >> > >> for i in range(10): > >>i = 10 > >> > >> What's your point, exactly ? > > > > > > In the first iteration, i i

handling secure attachments in email messages

2007-02-17 Thread Bernard Delmée
Hello, We have a processing chain automatically handling email attachments in python, which works well. We'd like to add support for encrypted files. We're using python 2.3 on HP-UX. I've checked the online 2.5 documentation, and my understanding is that the standard library still only has support

PyPy 0.99 released

2007-02-17 Thread Carl Friedrich Bolz
== pypy-0.99.0: new object spaces, optimizations, configuration ... == Welcome to the PyPy 0.99.0 release - a major snapshot and milestone of the last 8 months of

Re: Approaches of interprocess communication

2007-02-17 Thread Donn Cave
Quoth Steve Holden <[EMAIL PROTECTED]>: | Ben Finney wrote: ... | > If a programmer decides on behalf of the user that "localhost" should | > be treated specially, that programmer is making an error. | | Inter-process TCP/IP communication between two processes on the same | host invariably uses th

Re: Importing from upper directory

2007-02-17 Thread Gary Herron
Harlin Seritt wrote: > I have a script that I want to import called upper.py. It is 2 > directories above the script that will call it - i'll call that one > main.py. How am I able to import a script in a directory that is above > it? > > Thanks, > > Harlin > You can control the directories from

Re: f---ing typechecking

2007-02-17 Thread Donn Cave
Quoth Paul Rubin : | Donn Cave <[EMAIL PROTECTED]> writes: | > What this proves is that you can implement | > an argument list at run time, but it by no means changes the | > nature of the argument list as a sequence. | | Right, it's treated as a sequence rather than a rec

Re: WHAT IS THIS?

2007-02-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, James Stroud wrote: > Better would be to remove windows xp and get another operating system. Yeah XP is sooo ooold, the OP should install Vista. Or did you mean a real OS instead of just another one? ;-) SCNR, Marc 'BlackJack' Rintsch -- http://mail.python.org/

Re: why I don't like range/xrange

2007-02-17 Thread Bruno Desthuilliers
Roel Schroeven a écrit : > Bruno Desthuilliers schreef: > >> stdazi a écrit : > > >>> for (i = 0 ; i < 10 ; i++) >>>i = 10; >> >> >> for i in range(10): >>i = 10 >> >> What's your point, exactly ? > > > In the first iteration, i is set equal to 10. Then, before starting the > second i

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Bruno Desthuilliers
Stef Mientki a écrit : > Bruno Desthuilliers wrote: > >> Stef Mientki a écrit : >> >>> [EMAIL PROTECTED] wrote: >>> I am VB6 programmer and wants to start new programming language but i am unable to deciced. i have read about Python, Ruby and Visual C++. but i want to go t

Re: WHAT IS THIS?

2007-02-17 Thread James Stroud
Captain wrote: > Just bought a new PC with Windows XP Media Edition. I have two entries in > the "Add or Remove Programs" section of Control Panel, but there is no > corresponding item in the Start Menu. One entry says: Python 2.2.3 and the > other says: Python 2.2 pywin32 extensions (build203

Importing from upper directory

2007-02-17 Thread Harlin Seritt
I have a script that I want to import called upper.py. It is 2 directories above the script that will call it - i'll call that one main.py. How am I able to import a script in a directory that is above it? Thanks, Harlin -- http://mail.python.org/mailman/listinfo/python-list

Re: f---ing typechecking

2007-02-17 Thread Paul Rubin
"Paul McGuire" <[EMAIL PROTECTED]> writes: > This may be where the "tuple is like a struct" analogy isn't so good, > and "tuple is like a list but immutable" is better. Right, that's what I'm getting at. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Max Wilson
On Feb 17, 1:35 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > But I've done extensive, cross-platform development with Qt. And can > assert that it is unmatched in productivity and feature richness, > especially when combined with python. And certainly beat VB, and most > probably even delphi

download free computer books enjoy

2007-02-17 Thread [EMAIL PROTECTED]
Free Computer Education Ebooks,Tutorials and much more ASP, Business, C++, Careers, CISCO, e-books, Engineering, English, Filmmaking, Finance, Health, Leadership, Management, Marketing, Mathematics, Mobile, Oracle, Perl , Photography, PHP, Programming, VOIPand much more visit http

download free computer books enjoy

2007-02-17 Thread [EMAIL PROTECTED]
Free Computer Education Ebooks,Tutorials and much more ASP, Business, C++, Careers, CISCO, e-books, Engineering, English, Filmmaking, Finance, Health, Leadership, Management, Marketing, Mathematics, Mobile, Oracle, Perl , Photography, PHP, Programming, VOIPand much more visit http

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Don Taylor
[EMAIL PROTECTED] wrote: > I am VB6 programmer and wants to start new programming language but i > am unable to deciced. > > i have read about Python, Ruby and Visual C++. but i want to go > through with GUI based programming language like VB.net > By 'GUI based programming language' I think tha

Re: Help Required for Choosing Programming Language

2007-02-17 Thread goodwolf
In your situation consider C# too. If you like python then try IronPython for .NET. I think that C++ is not ideal for you. P.S.: VB6 is NOT a real OOP language. -- http://mail.python.org/mailman/listinfo/python-list

Re: WHAT IS THIS?

2007-02-17 Thread Grant Edwards
On 2007-02-17, Captain <[EMAIL PROTECTED]> wrote: > Just bought a new PC with Windows XP Media Edition. I have two entries in > the "Add or Remove Programs" section of Control Panel, but there is no > corresponding item in the Start Menu. One entry says: Python 2.2.3 and the > other says: Pyt

Re: cmd all commands method?

2007-02-17 Thread placid
placid wrote: > Hi all, > > if i want to treat every cmdloop prompt entry as a potential command > then i need to overwrite the default() method ? > > What i want to achieve is to be able to support global variable > creation for example; > > res = sum 1 2 > > this would create a variable res with

cmd all commands method?

2007-02-17 Thread placid
Hi all, if i want to treat every cmdloop prompt entry as a potential command then i need to overwrite the default() method ? What i want to achieve is to be able to support global variable creation for example; res = sum 1 2 this would create a variable res with the result of the method do_sum(

how do you expose pylons c variables to javascript functions

2007-02-17 Thread sqad
Hi, I am making a javascript call to google maps to get the geocodes of an address. Ok, so its trivial to get the latitude/longitude, but now I want to pass that data via the Pylons MVC framework so that my controllers have access to them. I could get the lat/long by instead going through HTTP vi

Re: Tkinter __call__

2007-02-17 Thread Gigs_
James Stroud wrote: > Gigs_ wrote: >> James Stroud wrote: >>> Gigs_ wrote: def printit(self, name): print name, 'returns =>', demos[name]() I have tried but cant get it to work properly. I want to instead printit method to put __call__ and call it like that

Re: f---ing typechecking

2007-02-17 Thread Chris Mellon
On 15 Feb 2007 16:04:14 -0800, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Feb 15, 5:21 pm, Paul Rubin wrote: > > How can there be a structure datatype with an unpredictable > > number of members? > > > > It might have come across as a different question-sorry for any >

Re: Enter Enter... troubles

2007-02-17 Thread Sorin Schwimmer
It works, thanks. Sorin Need Mail bonding? Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users. http://answers.yahoo.com/dir/?link=list&sid=396546091 -- http://mail.python.org/mailman/listinfo

Re: Reg Google Web Toolkit and Python

2007-02-17 Thread Daniel Nogradi
> > Hi , > > We have a project where I need to read files store > > them in database in the backend.We have done this in > > python.Now we decided to use Ajax technique for user > > interface.For that we found that GWT is one of the > > best toolkits.Now I got a doubt can I interface GWT > > with p

Re: WHAT IS THIS?

2007-02-17 Thread Laurent Pointal
Captain wrote: > Just bought a new PC with Windows XP Media Edition. I have two entries in > the "Add or Remove Programs" section of Control Panel, but there is no > corresponding item in the Start Menu. One entry says: Python 2.2.3 and > the > other says: Python 2.2 pywin32 extensions (build203

Re: HTTP_REFERER value

2007-02-17 Thread Johny
On Feb 17, 10:21 am, Roel Schroeven <[EMAIL PROTECTED]> wrote: > Johny schreef: > > > Is HTTP_REFERER value transfered between different domains? > > For example if I come to a website , say,www.python.org, from > > website www.microsoft.com > > willwww.python.orgfinds that I came there fromwww.mi

Re: Approaches of interprocess communication

2007-02-17 Thread Hendrik van Rooyen
"exhuma.twn" <[EMAIL PROTECTED]> wrote: > Hi all, > > Supposing you have two separate processes running on the same box, > what approach would you suggest to communicate between those two > processes. 8< -- sockets,webservices,CORBA,shared memory --- > Supposing both processes

Re: Pep 3105: the end of print?

2007-02-17 Thread Hendrik van Rooyen
"Steve Holden" <[EMAIL PROTECTED]> wrote: > Jean-Paul Calderone wrote: > > > > I think some people are confused that the language "Python 3.x" has "Python" > > in its name, since there is already a language with "Python" in its name, > > with which it is not compatible. > > > Right. Let's call Py

Re: builtin set literal

2007-02-17 Thread Hendrik van Rooyen
"Schüle Daniel" <[EMAIL PROTECTED]> wrote: > > > {:} for empty dict and {} for empty set don't look too much atrocious > > to me. > > this looks consistent to me I disagree. What would be consistent would be to follow the pattern, and use a different set of delimiters. Python uses () for tuple

Re: builtin set literal

2007-02-17 Thread Hendrik van Rooyen
"Paul Rubin" wrote: > Steven Bethard <[EMAIL PROTECTED]> writes: > > Yes, a lot of people liked this approach, but it was rejected due to > > gratuitous breakage. While Python 3.0 is not afraid to break backwards > > compatibility, it tries to do so only when there's

Re: Output to a text window

2007-02-17 Thread pdalet
Hi, http://spinecho.ifrance.com/frmouterr-py242-wxpy2621.zip I use this gui windows written by jean marie fauth, which is very easy: printing to stdout or stderr (gui windows written in wxpython). You have only to translate frmouterr in pygtk. ph DALET FRANCE On 17 fév, 01:19, [EMAIL

Re: WHAT IS THIS?

2007-02-17 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Shadab Sayani wrote: > --- Captain <[EMAIL PROTECTED]> wrote: > >> Just bought a new PC with Windows XP Media Edition. I gather Python is >> a programming language, but I am wondering why it was installed on my >> PC, and is it safe to remove it? I have no intention of lea

Re: HTTP_REFERER value

2007-02-17 Thread Roel Schroeven
Johny schreef: > Is HTTP_REFERER value transfered between different domains? > For example if I come to a website , say, www.python.org, from > website www.microsoft.com > will www.python.org finds that I came there from www.microsoft.com? If you get from www.microsoft.com to www.python.org by cl

Re: HTTP_REFERER value

2007-02-17 Thread Gabriel Genellina
En Sat, 17 Feb 2007 05:38:06 -0300, Johny <[EMAIL PROTECTED]> escribió: > Is HTTP_REFERER value transfered between different domains? > For example if I come to a website , say, www.python.org, from > website www.microsoft.com > will www.python.org finds that I came there from www.microsoft.com?

HTTP_REFERER value

2007-02-17 Thread Johny
Is HTTP_REFERER value transfered between different domains? For example if I come to a website , say, www.python.org, from website www.microsoft.com will www.python.org finds that I came there from www.microsoft.com? Thank you for help L. -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Diez B. Roggisch
> The final goal of programming language is (in most cases) > meant to create functional things, > that can assist people to perform their tasks. > The UI of that resulting thing should be optimal adapted to the final > audience (and task). > My audience is most comfortable with a intuitive GUI. >

Re: Help Required for Choosing Programming Language

2007-02-17 Thread Stef Mientki
Peter Decker wrote: > On 2/16/07, Stef Mientki <[EMAIL PROTECTED]> wrote: > >> In one of the other threads, Dabo was meant as a GUI designer, >> I tried it yesterday, >> and although it looks very promising, >> at the moment this is not a graphical design environment, >> just a complex (compared t