Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
George Sakkis wrote: > Fredrik Lundh wrote: > >> John Reese wrote: >> >> > It seems like it would be clear and mostly backwards compatible if the >> > + operator on any iterables created a new iterable that iterated >> > throught first its left operand and then its right, in the style of >> > iter

Re: MemoryError

2006-11-13 Thread Steve Holden
Bugra Cakir wrote: > Hi, > > Within a Python program how can we avoid getting "MemoryError" problem ? > Well that depends why you are getting it in the first place. If you can post the traceback your program prints out then you might get some specific advice for the current case. The usual advi

Jython compile errors ...

2006-11-13 Thread donkeyboy
All, I've tried the jythonc compiler to try and create an applet to see how it works, but I get a number of Java compile errors that are way above my knowledge. Does anyone know what any of the following means? I'm using JDK 1.5.0_09, under Win XP SP2. Runnnig the file " jython FILENAME" works, s

Re: adding python scripting to my application

2006-11-13 Thread Julian
"martdi" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jerry wrote: >> I am not a Python guru by any means, but I believe that when an >> application says that you can "script" their application with Python, >> it means that you can actually write Python code to interact with the

Re: explicit self revisited

2006-11-13 Thread Michele Simionato
Peter Maas wrote: > The Python FAQ 1.4.5 gives 3 reasons for explicit self (condensed version): > > 1. Instance variables can be easily distinguished from local variables. > > 2. A method from a particular class can be called as >baseclass.methodname(self, ). > > 3. No need for declarations to

httplib.InvalidURL: nonnumeric port: For characters in the proxy password in URL

2006-11-13 Thread Phoe6
Hi, The following piece of code works properly when my proxy password contains characters[a-zA-Z0-9] etc. But when my proxy password contained something like '|\/|' , the httplib incorrectly indentified it as separator. How do I resolve this issue. # Proxy Address PROXY_IP = "1.1.9.8:80" #

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
Fredrik Lundh wrote: > George Sakkis wrote: > > > The base object class would be one candidate, similarly to the way > > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. > > > > Alternatively, iter() could be a wrapper type (or perhaps mixin) > > instead of a function, somet

Re: httplib.InvalidURL: nonnumeric port: For characters in the proxy password in URL

2006-11-13 Thread Fredrik Lundh
Phoe6 wrote: > Hi, > The following piece of code works properly when my proxy password > contains characters[a-zA-Z0-9] etc. But when my proxy password > contained something like '|\/|' , the httplib incorrectly indentified > it as separator. if you want to prevent the URI parser from treatin

Re: httplib continuation packets

2006-11-13 Thread Steve Holden
Haakon Riiser wrote: > [Fredrik Lundh] > >> Haakon Riiser wrote: >> >>> Yes, and it doesn't help. >> then the server is mostly likely broken beyond repair. > > It's not in my power to upgrade the server, unfortunately. > Guess I'll have to use Perl. > >> to see if this really is the problem, you

Re: explicit self revisited

2006-11-13 Thread Steve Holden
Doug wrote: [...] > The explicit self is there simply because OOP was tacked onto python as > an afterthought. No, it was added in such a way that Python would be useful as a procedural as well as an OO language. I don't know what's got into me. can't-normally-say-boo-to-a-goose-ly y'rs - stev

Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
Dear all, I am looking for a data structure to hold rectangles in a 2d space. Please point me to any module which does these operations: Insert a rectangle into a particular co-ordinate. Get the rectangle/s right/left/above/below side to a particular rectangle. Get all the rectangles within a b

Re: reduce to be removed?

2006-11-13 Thread Steve Holden
Dustan wrote: > Alright, I can see I'm a bit outvoted here. I tried your suggestions > and it worked fine. > > I'll also try to consider in the future that part of the problem might > be lack of information conveyed on my part. > Well, since such honest and public self-examination is so rarely se

Re: Jython compile errors ...

2006-11-13 Thread [EMAIL PROTECTED]
If you are looking for an example of jython there is one in embeded in csound blue. available from the csounds.com website I believe. I have used it under the new java framework. I am not far enough along to know if you are missing brackets {} exc and () and one ; but you can try getting the pyt

Re: reduce to be removed?

2006-11-13 Thread Steve Holden
Dustan wrote: > Fredrik Lundh wrote: >> Dustan wrote: [...] >> Repeat after me: >> >> "Not everything has to be a one-liner." > > Not everything has to be a one-liner. But readability helps. > Indeed. And there is absolutely no conflict between those two statements. Guido resisted introducing te

Re: Decimal() instead of float?

2006-11-13 Thread Steve Holden
Michael B. Trausch wrote: > Is there a way to use Decimal() by default in Python instead of float? No. You'll just have to be explicit. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://hol

Re: reduce to be removed?

2006-11-13 Thread Steve Holden
Paddy wrote: > Dustan wrote: > >> Anyway, I figured out a way to get the builtin >> function 'sum' to work as I need: >> sum([[1,2,3],[4,5,6],[7,8,9]], []) >> > > Hah! > No-one expects sum to be used on anything but numbers. > > Except lists as above. > > No-one expects sum to be used on anyth

Re: Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
There are probily better ways to do this. The pil library has a rectangle drawing feature, I would check through the docs of wxwindows and tkinter unless this is homework because the pil people will not let you distribute pils. I am going to be looking for the same think let me know if you get a

Re: Jython compile errors ...

2006-11-13 Thread John Machin
[EMAIL PROTECTED] wrote: > If you are looking for an example of jython there is one in embeded in > csound blue. available from the csounds.com website I believe. I have > used it under the new java framework. I am not far enough along to > know if you are missing brackets {} exc and () and one

Re: Find interface associated with default route?

2006-11-13 Thread Steve Holden
Neal Becker wrote: [...] > > A quick strace reveals that 'route' just reads /proc/net/route, so: > C:\Steve>type /proc/net/route The syntax of the command is incorrect. C:\Steve>type \proc\net\route The system cannot find the path specified. Python, but not platform dependent :-) It would be n

Re: Data structure for ordered sequence

2006-11-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > unless this is homework because the pil people will not let > you distribute pils. I'm not sure I can parse this sentence fragment. What do you mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: reduce to be removed?

2006-11-13 Thread Fredrik Lundh
Steve Holden wrote: > In actual fact when Alex Martelli introduced sum() he intended it to be > polymorphic over all the container types including strings. The check to > exclude the string case was added when it was determined that it was > terribly inefficient to concatenate strings that way.

Re: Data structure for ordered sequence

2006-11-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I am looking for a data structure to hold rectangles in a 2d space. > Please point me to any module which does these operations: > Insert a rectangle into a particular co-ordinate. > Get the rectangle/s right/left/above/below side to a particular > rectangle. > Get a

Re: logging

2006-11-13 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi all ! > How to remove a logger ? > There si no logging.removeLogger(name) method. > I've a lot of objects that create loging. > When objects are destroyed, associated logger are not. This create > memory leak... Instead of removing unused loggers, reuse them. Calling

str.title question after '

2006-11-13 Thread Antoon Pardon
I have a text in ascii. I use the ' for an apostroph. The problem is this gives problems with the title method. I don't want letters after a ' to be uppercased. Here are some examples: argument result expected 't smidje 'T Smidje 't Smidje na'ama Na'Ama

Re: how is python not the same as java?

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

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
Georg Brandl wrote: > What has a better chance of success in my eyes is an extension to yield > all items from an iterable without using an explicit for loop: instead of > > for item in iterable: > yield item > > you could write > > yield from iterable > > or > > yield *iterable Since this is

Re: substring search without using built in utils

2006-11-13 Thread Bruno Desthuilliers
John Machin wrote: > Bruno Desthuilliers wrote: >> Gabriel Genellina wrote: >>> At Wednesday 8/11/2006 22:29, zeal elite wrote: >>> I am looking for substring search python program without using the built in funtions like find, or 'in'. >>> The only reasonable usage for such a constraint

Using signal.alarm to terminate a thread

2006-11-13 Thread Adrian Casey
I have a multi-threaded python application which uses pexpect to connect to multiple systems concurrently. Each thread within my application is a connection to a remote system. The problem is when one of the child threads runs a command which generates an unlimited amount of output. The classic

Re: Data structure for ordered sequence

2006-11-13 Thread [EMAIL PROTECTED]
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > I am looking for a data structure to hold rectangles in a 2d space. > > Please point me to any module which does these operations: > > Insert a rectangle into a particular co-ordinate. > > Get the rectangle/s right/left/above/below side to a

Re: str.title question after '

2006-11-13 Thread John Machin
Antoon Pardon wrote: > I have a text in ascii. I use the ' for an apostroph. The problem is > this gives problems with the title method. I don't want letters > after a ' to be uppercased. Here are some examples: > >argument result expected > > 't smidje 'T Smidje '

Re: str.title question after '

2006-11-13 Thread Leo Kislov
Antoon Pardon wrote: > I have a text in ascii. I use the ' for an apostroph. The problem is > this gives problems with the title method. I don't want letters > after a ' to be uppercased. Here are some examples: > >argument result expected > > 't smidje 'T Smidje

Re: reduce to be removed?

2006-11-13 Thread Steve Holden
Fredrik Lundh wrote: > Steve Holden wrote: [...] >> I suppose it's only a matter of time before someone wants to define >> dict.__add__ ... > > that's been proposed quite a few times, and always gets stuck when it's > time to define the exact semantics for dealing with collisions. there > are

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Carl Banks
George Sakkis wrote: > Fredrik Lundh wrote: > > > George Sakkis wrote: > > > > > The base object class would be one candidate, similarly to the way > > > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. > > > > > > Alternatively, iter() could be a wrapper type (or perhaps mix

Re: httplib.InvalidURL: nonnumeric port: For characters in the proxy password in URL

2006-11-13 Thread Phoe6
Fredrik Lundh wrote: > Phoe6 wrote: > > Hi, > > The following piece of code works properly when my proxy password > > contains characters[a-zA-Z0-9] etc. But when my proxy password > > contained something like '|\/|' , the httplib incorrectly indentified > > it as separator. > > if you want to

Re: httplib.InvalidURL: nonnumeric port: For characters in the proxypassword in URL

2006-11-13 Thread Fredrik Lundh
"Phoe6" wrote: >> if you want to prevent the URI parser from treating something as part of >> the URI, you need to quote it: >> >> pwd = urllib.quote(pwd, "") > > Tried this and did not work out. It ended up confusing urllib and > urllib2 objects. oh, please. urllib.quote is a *function*; th

Re: Using signal.alarm to terminate a thread

2006-11-13 Thread Nick Craig-Wood
Adrian Casey <[EMAIL PROTECTED]> wrote: > I have a multi-threaded python application which uses pexpect to connect to > multiple systems concurrently. Each thread within my application is a > connection to a remote system. The problem is when one of the child > threads runs a command which ge

An Invitation to Get Involved in Python Advocacy

2006-11-13 Thread Jeff Rush
I'd like to extend an invitation to those who would like to get involved in advocating the use of Python. In August, the PSF hired me, for a 6-mo contract, to coordinate the Python advocacy effort. Since then I've been working to make the next PyCon one of the best conferences yet, and putting

Set header from IMAP

2006-11-13 Thread Laszlo Nagy
Dear List, I'm trying to figure out, how to change the header of an e-mail that is accessed by an IMAP object. There is some code below (not a complete program). The key function is the filter_mail function. It should move/delete/change/export messages, based on their header. For exporting m

Re: logging

2006-11-13 Thread [EMAIL PROTECTED]
Diez B. Roggisch wote: > [EMAIL PROTECTED] wrote: > > > Hi all ! > > How to remove a logger ? > > There si no logging.removeLogger(name) method. > > I've a lot of objects that create loging. > > When objects are destroyed, associated logger are not. This create > > memory leak... > > Instead of re

Re: httplib.InvalidURL: nonnumeric port: For characters in the proxypassword in URL

2006-11-13 Thread Phoe6
Fredrik Lundh wrote: Hi Fredrik, I apologize if I offended you or have shown any impatience. I shall try again: > oh, please. urllib.quote is a *function*; there's no way that calling that > function > from code written for urllib2 will affect anything. > > but you can access url

Re: httplib.InvalidURL: nonnumeric port: For characters in theproxypassword in URL

2006-11-13 Thread Fredrik Lundh
"Phoe6" wrote: > - use urllib.quote() to covert the proxy url to a quoted one. you should use quote to convert the *password* to quoted form, not use it on the entire URL. -- http://mail.python.org/mailman/listinfo/python-list

Re: httplib.InvalidURL: nonnumeric port: For characters in theproxypassword in URL

2006-11-13 Thread Phoe6
Fredrik Lundh wrote: > "Phoe6" wrote: > > > - use urllib.quote() to covert the proxy url to a quoted one. > > you should use quote to convert the *password* to quoted form, not use it on > the entire URL. > Am sorry Fred. The same problem: File "C:\Python24\lib\httplib.py", line 598, in _set_hos

Re: logging

2006-11-13 Thread Jorge Vargas
On 12 Nov 2006 23:50:40 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all ! > How to remove a logger ? > There si no logging.removeLogger(name) method. > I've a lot of objects that create loging. why you need a logger per object? IMO 1 per package is more then enough. > When objects are

Python development time is faster.

2006-11-13 Thread Chris Brat
I've seen a few posts, columns and articles which state that one of the advantages of Python is that code can be developed x times faster than languages such as <>. Does anyone have any comments on that statement from personal experience? How is this comparison measured? Thanks Chris -- http:/

Re: how is python not the same as java?

2006-11-13 Thread Jorge Vargas
ok then they are the same lets all go back to write java -- http://mail.python.org/mailman/listinfo/python-list

Re: httplib continuation packets

2006-11-13 Thread Haakon Riiser
[Steve Holden] > It really does seem quite bizarre that a server should respond > differently to the same TCP request when it is split differently into IP > datagrams. > > There really is nothing wrong (from a standards point of view) with > sending FIN with your last data segment. FIN means "I

Re: Python development time is faster.

2006-11-13 Thread Fredrik Lundh
Chris Brat wrote: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? have you tried writing somet

Re: httplib.InvalidURL: nonnumeric port: For characters intheproxypassword in URL

2006-11-13 Thread Fredrik Lundh
"Phoe6" wrote: > Am sorry Fred. The same problem: > > File "C:\Python24\lib\httplib.py", line 598, in _set_hostport >raise InvalidURL("nonnumeric port: '%s'" % host[i+1:]) > httplib.InvalidURL: nonnumeric port: '|\' > > I dont think its an issue to be resolved with quote(). can you post the

Re: explicit self revisited

2006-11-13 Thread Hendrik van Rooyen
"Dennis Lee Bieber" <[EMAIL PROTECTED]> wrote: > Especially since there is a comefrom *breaks into song* : "Oh Susannah, now don't you cry for me..." -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Simon Brunning
On 11/11/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Hendrik van Rooyen wrote: > > >> blue is red or green or yellow > > > > *grin* - this can be construed as a weakness in Python - > > it's boolean logic, and it's incompatible with human use of the same > terms in all contexts, not just Python.

Re: logging

2006-11-13 Thread Diez B. Roggisch
> > That's a good idea but object name change (necessity). So what? You can log the name, but you don't need a logger with that name for that! Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development time is faster.

2006-11-13 Thread Paddy
Chris Brat wrote: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? > How is this comparison mea

Re: reduce to be removed?

2006-11-13 Thread Kay Schluehr
On 12 Nov., 00:14, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > if you care about writing robust code, why not just use a for-loop, > and the list extend method? > > Because generic solutions using HOFs increase abstraction and reduce() the amount of code one has to write even when they are outcas

Re: Python development time is faster.

2006-11-13 Thread Chris Brat
I work full time with Java, but downloaded python about a year ago and started playing. I've used it quite a few times in my working environment. -- http://mail.python.org/mailman/listinfo/python-list

Character Encodings and display of strings

2006-11-13 Thread JKPeck
I am trying to understand why, with nonwestern strings, I sometimes get a hex display and sometimes get the string printed as characters. With my Python locale set to Japanese and with or without a # coding of cp932 (this is Windows) at the top of the file, I read a list of Japanese strings into a

Re: Character Encodings and display of strings

2006-11-13 Thread Fredrik Lundh
"JKPeck" wrote: >I am trying to understand why, with nonwestern strings, I sometimes get > a hex display and sometimes get the string printed as characters. > > With my Python locale set to Japanese and with or without a # coding of > cp932 (this is Windows) at the top of the file, I read a list o

Re: article on Python 2.5 features

2006-11-13 Thread Michele Simionato
Beliavsky wrote: > A Parade of New Features Debuts in Python 2.5 > by Gigi Sayfan > "Python 2.5 still has the smell of fresh paint but it's the perfect > time to drill down on the most important new features in this > comprehensive release. Read on for detailed explanations and examples > of except

Find how to embed the BitTorrent in my program

2006-11-13 Thread 张沈鹏
Is there any module can easy embed the BitTorrent(both tracker and client) in myself's program . Or where can find the documents for reuse official BitTorrent . Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Character Encodings and display of strings

2006-11-13 Thread JKPeck
Thanks for the quick answer. I thought repr was involved here, but when I use repr explicitly I get a notation where the backslashes are escaped. I also though that with the encoding explictily declared in the source, that repr would take that into account and use the character form, but obviousl

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread George Sakkis
Carl Banks wrote: > George Sakkis wrote: > > Fredrik Lundh wrote: > > > > > George Sakkis wrote: > > > > > > > The base object class would be one candidate, similarly to the way > > > > __nonzero__ is defined to use __len__, or __contains__ to use __iter__. > > > > > > > > Alternatively, iter() co

Re: Fredrik Lundh [was "Re: explicit self revisited"]

2006-11-13 Thread fynali
> You idiot. Putting the word "official" in front of something doesn't > mean it can't be FUD. Especially when it is written by people such as > yourself. Have you not paid attention to anything happening in > politics around the world during your lifetime? Ridiculous boo-llshit! -- http://ma

CORBA: Fnorb Problems

2006-11-13 Thread rodmc
Hi, I have installed Fnorb and everything seems to have gone ok. However I keep getting the error message below. This is despite the fact that the MS CL c++ preprocessor seems to be in PATH. I can type "cl" and although I get nothing back in the DOS window, there is also no error message. Traceba

Re: Python development time is faster.

2006-11-13 Thread Harry George
"Chris Brat" <[EMAIL PROTECTED]> writes: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? > How

Re: Python development time is faster.

2006-11-13 Thread Steven Bethard
Chris Brat wrote: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? I had to work at a laborator

Re: httplib.InvalidURL: nonnumeric port: For characters intheproxypassword in URL

2006-11-13 Thread Phoe6
Fredrik Lundh wrote: > > can you post the code you're using to build the URI ? > Okay. This piece of code fetches a page from a particular site. As I am behind a firewall, I have to communicate through a proxy. # Set the Proxy Address PROXY_IP = "10.1.9.4:80" # Trying with linear way proxy_user

Re: how is python not the same as java?

2006-11-13 Thread Bruno Desthuilliers
Jorge Vargas wrote: > ok then they are the same lets all go back to write java No, thanks... I'll keep my snake !-) And actually, I'm afraid I somewhat misunderstood your previous post - I took it as meaning "Python has a REPL and you don't have to explicitelly call the compiler so Python is

Re: httplib.InvalidURL: nonnumeric port: For charactersintheproxypassword in URL

2006-11-13 Thread Fredrik Lundh
"Phoe6" wrote: > proxy_password = urllib.quote(proxy_password_orig) make that: proxy_password = urllib.quote(proxy_password_orig, "") -- http://mail.python.org/mailman/listinfo/python-list

Re: Python development time is faster.

2006-11-13 Thread George Sakkis
Steven Bethard wrote: > A simple example from document indexing. Using Java Lucene to index > some documents, you'd write code something like:: > > Analyzer analyzer = new StandardAnalyzer() > IndexWriter writer = new IndexWriter(store_dir, analyzer, true) > for (Value value: value

Re: CORBA: Fnorb Problems

2006-11-13 Thread Diez B. Roggisch
rodmc wrote: > Hi, > > I have installed Fnorb and everything seems to have gone ok. However I > keep getting the error message below. This is despite the fact that the > MS CL c++ preprocessor seems to be in PATH. I can type "cl" and > although I get nothing back in the DOS window, there is also

Re: httplib.InvalidURL: nonnumeric port: For characters in the proxypassword in URL

2006-11-13 Thread Sion Arrowsmith
Fredrik Lundh <[EMAIL PROTECTED]> wrote: urllib.quote > urllib2.quote > >>> urllib.quote >>> urllib2.quote Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'quote' >>> sys.version '2.4.1 (#2, May 5 2005, 11:32:06) \n[GCC 3.3.5

Re: Python development time is faster.

2006-11-13 Thread Diez B. Roggisch
> Oh, the memories... I went down the same road about two years ago, > though I didn't know about PyLucene at the time and wrapped in jython > the parts of Lucene I used... never bothered to deal with java's > verbosity after that. It's a pity that jython resembles abandon-ware > these days, when j

Dr. Dobb's Python-URL! - weekly Python news and links (Nov 13)

2006-11-13 Thread Cameron Laird
QOTW: "It is humbling to see how simple yet powerfull python`s view on things is" - Éric Daigneault http://groups.google.com/group/comp.lang.python/msg/bbd842715bb5b6eb "[I]f a machine is expected to be infallible, it cannot also be intelligent." - Alan Turing, 20 February 1947, lecture

Re: Character Encodings and display of strings

2006-11-13 Thread Diez B. Roggisch
JKPeck wrote: > Thanks for the quick answer. I thought repr was involved here, but > when I use repr explicitly I get a notation where the backslashes are > escaped. I also though that with the encoding explictily declared in > the source, that repr would take that into account and use the > cha

tab compleation input

2006-11-13 Thread Eli Criffield
Here is what i want to do. I have a question in my program, and i want to do tab completion for the valid answers. Say i have : --snip-- validanswers = [ 'yes', 'no', 'maybe', 'tuesday', 'never' ] #and i ask sys.stdout.write("Answer the Question: ") answer = sys.stdin.readline().rstrip() if ans

Re: CORBA: Fnorb Problems

2006-11-13 Thread rodmc
> > I used omniorb, and have been very satisfied with it. You might consider > switching. > > Diez Thanks, I have just downloaded that plus omniORBpy as well. I have the binary version of omniORB but need to build omniORBpy, from what I can see the build process is aimed at GCC and not VC++. Anywa

Re: Python 3000 idea -- + on iterables -> itertools.chain

2006-11-13 Thread Georg Brandl
Carl Banks wrote: > Georg Brandl wrote: >> What has a better chance of success in my eyes is an extension to yield >> all items from an iterable without using an explicit for loop: instead of >> >> for item in iterable: >> yield item >> >> you could write >> >> yield from iterable >> >> or >>

Re: handling many default values

2006-11-13 Thread Michele Simionato
Alan Isaac wrote: > Also, as an aside, no one objected to using > self.__dict__.update(kwargs) > in the __init__ function of the parameter holding class. It is a common trick, also shown in the Python cookbook, IIRC. If you are anal about double underscores, you can also use vars(self).update

Re: CORBA: Fnorb Problems

2006-11-13 Thread Eric Brunel
On Mon, 13 Nov 2006 16:16:37 +0100, rodmc <[EMAIL PROTECTED]> wrote: > Hi, > > I have installed Fnorb and everything seems to have gone ok. However I > keep getting the error message below. This is despite the fact that the > MS CL c++ preprocessor seems to be in PATH. I can type "cl" and > alth

Elliptic Curve Simple Example

2006-11-13 Thread flit
Hello, I am trying the Python Cryptography Toolkit, but I didnt succeed, maybe I am not used to technical programming docs. WHat I succeed, using the the AES example to encrypt and decrypt. How Can I change it to use elliptic curves cryptography? Anyone has a working example, in python to use ell

Re: explicit self revisited

2006-11-13 Thread Simon Brunning
On 11/13/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > > > I suppose that in his view, language advocacy is a zero-sum game, so > > positive comments about Python can be considered as FUD against his own > > project. He's even invented his own del.icio.us tag for this purpose: > > > > http:/

Re: Python component model

2006-11-13 Thread Magnus Lycka
sturlamolden wrote: > There is a whole generation of computer users out there scared stiff of > using the keyboard. Soon, computers will not have a keyboard at all. > The trend is perhaps more pronounced among managers not writing code > themselves, but "taking decisions" about which tools to use.

Re: explicit self revisited

2006-11-13 Thread Christophe
Simon Brunning a écrit : > On 11/13/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> >> > I suppose that in his view, language advocacy is a zero-sum game, so >> > positive comments about Python can be considered as FUD against his own >> > project. He's even invented his own del.icio.us tag for th

Singleton Class Exception

2006-11-13 Thread dischdennis
Hello List, I would like to make a singleton class in python 2.4.3, I found this pattern in the web: class Singleton: __single = None def __init__( self ): if Singleton.__single: raise Singleton.__single Singleton.__single = self the line "raise Singleton.__s

Re: Python development time is faster.

2006-11-13 Thread Egon Frerich
Chris Brat schrieb: > I've seen a few posts, columns and articles which state that one of the > advantages of Python is that code can be developed x times faster than > languages such as <>. > > Does anyone have any comments on that statement from personal > experience? > How is this comparison mea

Is python for me?

2006-11-13 Thread lennart
Hi, I'm planning to learn a language for 'client' software. Until now, i 'speak' only some web based languages, like php. As a kid i programmed in Basic (CP/M, good old days :'-) ) Now i want to start to learn a (for me) new computer language. I like Python. Its free, easy to learn and some favor

Re: Python development time is faster.

2006-11-13 Thread flit
One thing I really like, is making "prototypes" on python. Just to test some algorithm or procedure. It is very fast and easy to debug. So after, I make it in c++ (but not too much often, I leave it in python today.) Chris Brat wrote: > I've seen a few posts, columns and articles which state that

Re: Py3K idea: why not drop the colon?

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

Research Master 0.1 (GPL/Python)

2006-11-13 Thread ccosse
ResearchMaster has been designed to simplify management of research literature. It is a GUI interface to a system of folders and records. Each record contains notes, meta info and BibTex info about an associated file. Instances of the single copy of a record can occur throughout the folder system,

jython's future (was: Python development time is faster.)

2006-11-13 Thread Stefan Behnel
Diez B. Roggisch wrote > I wouldn't consider jython abandonware. It is under active development, and > I'm using a 2.2 alpha successful for quite a while now - which usually > serves my needs. > > The problem is/was that new-style classes were a major hurdle to take, and > this now seems to be con

Re: Singleton Class Exception

2006-11-13 Thread Jason
dischdennis wrote: > Hello List, > > I would like to make a singleton class in python 2.4.3, I found this > pattern in the web: > > class Singleton: > __single = None > def __init__( self ): > if Singleton.__single: > raise Singleton.__single > Singleton.__single

Re: jython's future (was: Python development time is faster.)

2006-11-13 Thread Carsten Haese
On Mon, 2006-11-13 at 18:34 +0100, Stefan Behnel wrote: > Honestly, how many important Python modules do still run on 2.2? InformixDB still compiles on 2.2 except when I accidentally temporarily break backwards compatibility. Of course it's a matter of opinion whether it qualifies as an important

Re: Character Encodings and display of strings

2006-11-13 Thread JKPeck
It seemed to me that this sentence For many types, this function makes an attempt to return a string that would yield an object with the same value when passed to eval(). might mean that the encoding setting of the source file might influence how repr represented the contents of the string. Noth

Re: jython's future

2006-11-13 Thread Steve Holden
Carsten Haese wrote: > On Mon, 2006-11-13 at 18:34 +0100, Stefan Behnel wrote: >> Honestly, how many important Python modules do still run on 2.2? > > InformixDB still compiles on 2.2 except when I accidentally temporarily > break backwards compatibility. > > Of course it's a matter of opinion wh

Re: Singleton Class Exception

2006-11-13 Thread Dan Lenski
dischdennis wrote: > the line "raise Singleton.__single" invokes in my class the following > error: > > exceptions must be classes, instances, or strings (deprecated), not > PurchaseRequisitionController Denis, Jason's explanation is correct! You are trying to use the Singleton instance as the ex

httplib.ResponseNotReady question

2006-11-13 Thread Max
Hi, Group. I'm not a Python programmer so this question may be really basic or stupid. :) I have some code that sends a simple request to an end-point and reads the response. That works just fine. When I put the code in a for loop though I get httplib.ResponseNotReady error message. It seems t

Re: Is python for me?

2006-11-13 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, lennart <[EMAIL PROTECTED]> wrote: >Hi, > >I'm planning to learn a language for 'client' software. Until now, i >'speak' only some web based languages, like php. As a kid i programmed >in Basic (CP/M, good old days :'-) ) Now i want to start to learn a >(for me) new

Re: Py3K idea: why not drop the colon?

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

Re: explicit self revisited

2006-11-13 Thread Peter Maas
Michele Simionato wrote: > Peter Maas wrote: >> All these reasons are valid and retained by the following suggestion: let >> self be represented by the dot > > This suggestion has been discussed in the past (I remember having the > same idea myself when I first learned Python). But at the end I b

Re: Is python for me?

2006-11-13 Thread [EMAIL PROTECTED]
As stated above python is capable of all those things, however on larger applications like that it can tend to slow down a bit. And the executables do need a little bit of work, because it's bassicly a dll and a library of all your .pyc files. However python is still a great language and I would re

Re: Py3K idea: why not drop the colon?

2006-11-13 Thread Michael Hobbs
Antoon Pardon wrote: > On 2006-11-11, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > >> On Fri, 10 Nov 2006 13:16:32 -0600, Michael Hobbs wrote: >> >> >>> Yeah, okay, I didn't read through the details of the PEP. I picked a bad >>> example to illustrate a point that is still true. The FAQ al

  1   2   >