Re: Abelson and Python

2006-11-23 Thread Fredrik Lundh
markscottwright wrote: If it were that easy, the PyPy guys would be done by now. if the PyPy guys had focused on writing a Python interpreter in Python, they'd been done by now. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: utf - string translation

2006-11-23 Thread Fredrik Lundh
Klaas wrote: It's not too hard to imagine an accentual difference, eg: especially in languages where certain combinations really are distinct letters, not just letters with accents or silly marks. I have a Swedish children's book somewhere, in which some characters are harassed by a big ugly

Re: utf - string translation

2006-11-23 Thread Eric Brunel
On Wed, 22 Nov 2006 22:59:01 +0100, John Machin [EMAIL PROTECTED] wrote: [snip] So why do you want to strip off accents? The history of communication has several examples of significant difference in meaning caused by minute differences in punctuation or accents including one of which you

How do I find possible matches using regular expression?

2006-11-23 Thread Andy
Hi there, I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if user keep on inputting characters after 'ma', so how do I mark 'ma' as a possible match string? Thanks a

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Paul McGuire
Andy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if user keep on inputting characters after

Re: The Python Papers Edition One

2006-11-23 Thread Tool69
I've recently tried the docutils's reST module with Pygments ( to highlight Python sources), so you can have LaTeX + HTML + PDF output (You can see what it renders here : h**p://kib2.free.fr/geoPyX/geoPyX.html ). It worked fine, but needs a little work to suit your needs (you'll have to write your

Finding the carret position in a regular expression

2006-11-23 Thread Tool69
Hi, supposed I've got the following text : mytext = for myvar in somelist: with the following simple pattern : pattern = [a-z]+ I use re.findall(pattern, mytext) wich returns : ['myvar','somelist'] Now, I want my prog to return the positions of the returned list elements, ie : myvar was found

Using SimpleXMLRPCServer in a Windows Service

2006-11-23 Thread Rudy Schockaert
After some Googling I found a post of someone who wanted to do exactly as what I want to do now. There is however a problem in his code that makes the service fails after the first connection. I slightly modified his code and now I can run the service longer before I run into trouble. I then tried

psyco-simplified idioms ?

2006-11-23 Thread Boris Borcic
I am curious about idioms instinctively avoided by experienced programmers because of inefficiencies that psyco eliminates. IOW, are there any identifiable ways in which the backing of psyco promotes simpler code by eliminating efficiency concerns ? Best, BB --

Re: Finding the carret position in a regular expression

2006-11-23 Thread Fredrik Lundh
Tool69 wrote: supposed I've got the following text : mytext = for myvar in somelist: with the following simple pattern : pattern = [a-z]+ I use re.findall(pattern, mytext) wich returns : ['myvar','somelist'] Now, I want my prog to return the positions of the returned list elements,

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Andy
The problem is the input will be much more complex than the example, it could be something like 30 minutes later where any string starting with a number is a possible match. Paul McGuire 寫道: Andy [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi there, I'm trying to do some

Re: Finding the carret position in a regular expression

2006-11-23 Thread Tool69
Thanks Fredrik, I was not aware of finditer. Iterators are very usefull ! -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Fredrik Lundh
Andy wrote: The problem is the input will be much more complex than the example, it could be something like 30 minutes later where any string starting with a number is a possible match. so if I type 1, are you going to suggest all possible numbers that start with that digit? doesn't strike

Re: How do I find possible matches using regular expression?

2006-11-23 Thread John Machin
Andy wrote: Hi there, I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if user keep on inputting characters after 'ma', so how do I mark 'ma' as a possible match

Re: X class missing in Python :-) - Re: What's going on here?

2006-11-23 Thread robert
John Machin wrote: robert wrote: Dale Strickland-Clark wrote: Python 2.4.2 (#1, Oct 13 2006, 17:11:24) [GCC 4.1.0 (SUSE Linux)] on linux2 Type help, copyright, credits or license for more information. a = object() a object object at 0xb7bbd438 a.spam = 1 Traceback (most recent call

sys.stderr.write and sys.exit

2006-11-23 Thread GinTon
Is the same use _sys.stderr.write('error message'); sys.exit(1)_ than _sys.exit('error message')_ ? Note: help(sys.exit) If the status is omitted or None, it defaults to zero (i.e., success). If the status is numeric, it will be used as the system exit status. If it is another kind of object, it

len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Tor Erik Soenvisen
Hi, (len(['']) is 1) == (len(['']) == 1) = True Is this the case for all numbers? I've tried running the following: for i in range(1): for j in range(1): if i != j: assert id(i) != id(j), 'i=%d, j=%d, id=%d' % (i, j, id (i)) which

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Fredrik Lundh
Tor Erik Soenvisen wrote: (len(['']) is 1) == (len(['']) == 1) = True Is this the case for all numbers? I'm not sure what you're asking here, but if you digest the following facts, maybe you can answer it yourself: 1) all objects that exist at the same time have distinct identifies, and

How do I separate my parameters with spawnv

2006-11-23 Thread Fabio Chelly
Hi, I have a command line that works fine when I execute it directly: c:\\curl.exe -T c:\\upload.txt -u login:pwd ftp://ftp-myurl --ftp-ssl But when I try to use os.spawnv to excute it from my python code, it doesn't work at all. Here is my code: exe = c:\\curl.exe f = c:\\upload.txt logon =

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Peter Otten
Andy wrote: I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if user keep on inputting characters after 'ma', so how do I mark 'ma' as a possible match string? The

Re: PyQt app in seperate thread

2006-11-23 Thread Jeremy Sanders
anders wrote: OK I see that now. Thanks for pointing that out. So basically, I can't do what I want at all. That's a bit of a pain. Is there no way of tricking Qt into thinking I'm running it in the main thread? I have an app which runs Qt in a separate thread and allows the user to send it

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Peter Otten
Tor Erik Soenvisen wrote: (len(['']) is 1) == (len(['']) == 1) = True Is this the case for all numbers? I've tried running the following: for i in range(1): for j in range(1): if i != j: assert id(i) != id(j), 'i=%d, j=%d,

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Fredrik Lundh
distinct identifies don't trust your spellchucker. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I separate my parameters with spawnv

2006-11-23 Thread Fredrik Lundh
Fabio Chelly wrote: But when I try to use os.spawnv to excute it from my python code, it doesn't work at all. Here is my code: exe = c:\\curl.exe f = c:\\upload.txt logon = login:pwd url = ftp://ftp-myurl; import os os.spawnv(os.P_WAIT, exe, [-T, f, -u, logon, url, --ftp-ssl]) iirc,

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Richard Brodie
Tor Erik Soenvisen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] which executes fine. Hence, 0- is okey... But this is a relatively small range, and sooner or later you probably get two numbers with the same id... Thoughts anyone? I think you are confusing yourself

10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Daniel Austria
Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this is not a nice solution daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Tim Williams
On 23 Nov 2006 03:13:10 -0800, Daniel Austria [EMAIL PROTECTED] wrote: Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this is not a nice solution Not nice, especially if you

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Steven D'Aprano
On Thu, 23 Nov 2006 10:48:32 +, Tor Erik Soenvisen wrote: Hi, (len(['']) is 1) == (len(['']) == 1) = True You shouldn't rely on this behaviour: x = 10 len('a' * x) == x True len('a' * x) is x False (Your results may vary -- this depends on the implementation.) Is this the

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Tech
Daniel Austria a écrit : Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this is not a nice solution daniel If you're sure that there's only ints l = [int(item) for

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Steven D'Aprano
On Thu, 23 Nov 2006 03:13:10 -0800, Daniel Austria wrote: Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this is not a nice solution It is a dangerous solution if your

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread John Machin
Daniel Austria wrote: Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this is not a nice solution Most people share your opinion. Try this: | strg = 10, 20, 30 | [int(x)

Re: Abelson and Python

2006-11-23 Thread markscottwright
Fredrik Lundh wrote: markscottwright wrote: If it were that easy, the PyPy guys would be done by now. if the PyPy guys had focused on writing a Python interpreter in Python, they'd been done by now. /F Isn't that the point of PyPy? It's what their mission statement says

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Tim Williams
On 23/11/06, Steven D'Aprano [EMAIL PROTECTED] wrote: On Thu, 23 Nov 2006 03:13:10 -0800, Daniel Austria wrote: Sorry, how can i convert a string like 10, 20, 30 to a list [10, 20, 30] what i can do is: s = 10, 20, 30 tmp = '[' + s + ']' l = eval(tmp) but in my opinion this

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Tor Erik Soenvisen
Steven D'Aprano [EMAIL PROTECTED] wrote in news:[EMAIL PROTECTED]: On Thu, 23 Nov 2006 10:48:32 +, Tor Erik Soenvisen wrote: Hi, (len(['']) is 1) == (len(['']) == 1) = True You shouldn't rely on this behaviour: x = 10 len('a' * x) == x True len('a' * x) is x False

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Duncan Booth
Steven D'Aprano wrote: No, you will never get two objects existing at the same time with the same id. You will get two objects that exist at different times with the same id, since ids may be reused when the object is deleted. I think it is worth pointing out that this is an area where

socket.error connection refused

2006-11-23 Thread Vania
Hi, I'm not sure this is the proper forum but I try nevertheless. The problem I'am facing is that the socket library always fail to connect to an URL. The net effect is that I can not use setuptools. I'm using Python2.4 on a windows XPPRO Sp2 machine. The firewall is disabled. There is no NLTM

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Duncan Booth
Tor Erik Soenvisen [EMAIL PROTECTED] wrote: I've seen code like this: if type([]) is list: print 'Is list' which seem to work. 'seem to work' is correct. Occasionally 'type(x) is list' is exactly what is needed, but much more likely it is a potential bug. It is more likely

Re: socket.error connection refused

2006-11-23 Thread Tim Williams
On 23 Nov 2006 04:09:18 -0800, Vania [EMAIL PROTECTED] wrote: Hi, I'm not sure this is the proper forum but I try nevertheless. The problem I'am facing is that the socket library always fail to connect to an URL. The net effect is that I can not use setuptools. I'm using Python2.4 on a windows

Re: socket.error connection refused

2006-11-23 Thread Vania
Hi, the reason I mentioned the socket is because that is where the error eventually occurs. the code I tried manually (with different urls including a local one) is the following: import urllib fo=urllib.urlopen(http://www.google.com;) the error I get is: File stdin, line 1, in ? File

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Rob De Almeida
Ben Finney wrote: I was under the impression that WSGI in mod_python was a rather kludgy way to do WSGI, but I don't know what the alternatives are. CGI? Python http server (e.g. CherryPy)? Something else? You can use FastCGI or SCGI too, with Apache, lighttpd or Cherokee. I have a short

Re: The Python Papers Edition One

2006-11-23 Thread kilnhead
I for one like the pdf format. Nothing irks me more than help files in multipage HTML. I want a document I can easily download and save. Thanks for your efforts. [EMAIL PROTECTED] wrote: Greetings all, Some of you may have noticed the launch of the Python Journal a while back. Due to

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Paul Boddie
Rob De Almeida wrote: Ben Finney wrote: I was under the impression that WSGI in mod_python was a rather kludgy way to do WSGI, but I don't know what the alternatives are. CGI? Python http server (e.g. CherryPy)? Something else? You can use FastCGI or SCGI too, with Apache, lighttpd or

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Andy
OK, here's what I want... I'm doing a auto-tasking tool in which user can specify the execution rule by inputting English instead of a complex GUI interface(Normally a combination of many controls). This way is way better user interaction. So the problem comes down to understanding user input

Re: How do I find possible matches using regular expression?

2006-11-23 Thread Andy
The seems good to me, I'll try it out, thanks for the posting. Peter Otten 写道: Andy wrote: I'm trying to do some predicting work over user input, here's my question: for pattern r'match me', the string 'no' will definitely fail to match, but 'ma' still has a chance if user keep on

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Fredrik Lundh
Tor Erik Soenvisen wrote: I've seen code like this: if type([]) is list: print 'Is list' which seem to work. And also I've seen var is None, as you mention. None is guaranteed to be a singleton: http://effbot.org/pyref/type-none.htm Why is works for type objects should be pretty

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Stefan Behnel
Tor Erik Soenvisen wrote: (len(['']) is 1) == (len(['']) == 1) = True len(['']) 1 len(['']) is 1 True len(['']) == 1 True True == True True (len(['']) is 1) == (len(['']) == 1) True What did you expect? Stefan --

Re: socket.error connection refused

2006-11-23 Thread Bjoern Schliessmann
Vania wrote: IOError: [Errno socket error] (10061, 'Connection refused') What does telnet www.google.com 80 in some cmd.exe window say? The same? Regards, Björn -- BOFH excuse #36: dynamic software linking table corrupted -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, main loop question.

2006-11-23 Thread Bjoern Schliessmann
Exod wrote: Don't know if its possible in this light-weight GUI toolset, but can i somehow hook up into the mainloop in it, for example if i were to create an internet application, i would need to keep recieving data from within it? That's something where you could try the Twisted framework

Re: Porting Tkinter application to JYthon

2006-11-23 Thread Andre Burgaud
Hi Sandip, JPype could be a solution to implement the second option mentioned by Tim: http://jpype.sourceforge.net/ Thanks, Andre http://www.burgaud.com/ On 23 Nov 2006 05:36:46 -0800, Tim N. van der Leeuw [EMAIL PROTECTED] wrote: Hi, sandip desale wrote: Dear All, We have a Tcl/Tk

ldapsearch example in python-ldap?

2006-11-23 Thread Nico Grubert
Hi there, on a linux machine I am running this ldapsearch from the command line: ldapsearch -x -h myldaphost.mydomain.com \ -D CN=ldapuser,CN=Users,DC=mydomain,DC=com -w secret \ -b CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com How can I do this with python-ldap? Regards, Nico --

Re: How do I separate my parameters with spawnv

2006-11-23 Thread Fabio Chelly
Thank you very much -- Ceci est une signature automatique de MesNews. Site : http://www.mesnews.net -- http://mail.python.org/mailman/listinfo/python-list

Email headers and non-ASCII characters

2006-11-23 Thread Christoph Haas
Hello, everyone... I'm trying to send an email to people with non-ASCII characters in their names. A recpient's address may look like: Jörg Nørgens [EMAIL PROTECTED] My example code: = def sendmail(sender, recipient, body, subject): message = MIMEText(body)

Re: combining the path and fileinput modules

2006-11-23 Thread Rob Wolfe
wo_shi_big_stomach wrote: Newbie to python writing a script to recurse a directory tree and delete the first line of a file if it contains a given string. I get the same error on a Mac running OS X 10.4.8 and FreeBSD 6.1. Here's the script: # start of program # p.pl - fix broken SMTP

non blocking i o, The deep freeze.

2006-11-23 Thread guy . flowers
Hi Have a problem, Ill give some history to the problem and add a little example code to start with to see if anybody can help or if I am correct in what the problem is. I have been looking on the newsgroups and have found lots of stuff on the problem but no solutions as of yet, will keep

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Fredrik Lundh
Tim Williams wrote: It is a dangerous solution if your data is coming from an untrusted source. s = 10, 20, 30 L = [x.strip() for x in s.split(',')] L ['10', '20', '30'] L = [int(x) for x in L] L [10, 20, 30] Or, as a one liner: [int(x.strip()) for x in s.split(',')] You don't

Re: Email headers and non-ASCII characters

2006-11-23 Thread Christoph Haas
On Thursday 23 November 2006 15:12, I wrote: My example code: = def sendmail(sender, recipient, body, subject): message = MIMEText(body) message['Subject'] = Header(subject, 'iso-8859-1') message['From'] = Header(sender, 'iso-8859-1')

Re: socket.error connection refused

2006-11-23 Thread Vania
Hi, the telnet call succeed Vania Bjoern Schliessmann ha scritto: Vania wrote: IOError: [Errno socket error] (10061, 'Connection refused') What does telnet www.google.com 80 in some cmd.exe window say? The same? Regards, Björn -- BOFH excuse #36: dynamic software linking

Re: non blocking i o, The deep freeze.

2006-11-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: The whole thing works pretty well, a part from every so offen completely randomly the 3 machines seem to freeze (or to put in the terms of our sys admin it trashes them). thrashing? that usually means that a process uses too much memory, thus causing the system to

Re: 10, 20, 30 to [10, 20, 30]

2006-11-23 Thread Tim Williams
On 23/11/06, Fredrik Lundh [EMAIL PROTECTED] wrote: Tim Williams wrote: and the use of a list comprehension is pretty silly to, given that you want to apply the same *function* to all items, and don't really need to look it up for every item: map(int, s.split(',')) Haha, thanks

ImportError: No module named getopt

2006-11-23 Thread prashant
I am running a python script which has the line import getopt, sys, os, re, string And i get the error ImportError: No module named getopt Could you please point out a possible solution for this? -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand Python objects

2006-11-23 Thread Aahz
In article [EMAIL PROTECTED], Ben Finney [EMAIL PROTECTED] wrote: Typically, classes are created as a subclass of another class. The top-level basic type in Python is 'object', so if your class doesn't make sense deriving from anything else, derive from 'object'. class Point(object):

Re: combining the path and fileinput modules

2006-11-23 Thread wo_shi_big_stomach
On 11/23/06 6:15 AM, Rob Wolfe wrote: wo_shi_big_stomach wrote: Newbie to python writing a script to recurse a directory tree and delete the first line of a file if it contains a given string. I get the same error on a Mac running OS X 10.4.8 and FreeBSD 6.1. Here's the script: # start of

Re: ImportError: No module named getopt

2006-11-23 Thread Fredrik Lundh
prashant wrote: I am running a python script which has the line import getopt, sys, os, re, string And i get the error ImportError: No module named getopt Could you please point out a possible solution for this? looks like a broken installation. try running the script as python -vv

Re: Trying to understand Python objects

2006-11-23 Thread Aahz
In article [EMAIL PROTECTED], walterbyrd [EMAIL PROTECTED] wrote: Is there some book, or other reference, that explains of this? I was thinking about Python for Dummies. The Think like a Computer Scientist book, and Dive into Python book don't seem to explain Python's object model clearly enough

Simple threading

2006-11-23 Thread jrpfinch
I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. Many thanks Jon import threading import sys import time global g_datum global g_rawfile global

Re: PyParsing and Headaches

2006-11-23 Thread Bytter
Heya there, Ok, found the solution. I just needed to use leaveWhiteSpace() in the places I want pyparsing to take into consideration the spaces. Thx for the help. Cheers! Hugo Ferreira On Nov 23, 11:57 am, Bytter [EMAIL PROTECTED] wrote: (This message has already been sent to the

Re: Email headers and non-ASCII characters

2006-11-23 Thread Max M
Christoph Haas skrev: Hello, everyone... I'm trying to send an email to people with non-ASCII characters in their names. A recpient's address may look like: Jörg Nørgens [EMAIL PROTECTED] My example code: = def sendmail(sender, recipient, body,

Re: The Python Papers Edition One

2006-11-23 Thread jdunck
[EMAIL PROTECTED] wrote: 1.) It takes too many clicks to download. A) We know, but it's like that to save our server. We will be publishing to a number of online archives, back-issues may be back-linkable from those. Please consider using S3, coral cache, or similar to distribute, if the

Re: Simple threading

2006-11-23 Thread hg
jrpfinch wrote: I'm just getting started on threading and was wondering why the following code does not work (i know globals is bad style - I'll eliminate them eventually). All I get is a blank cursor flashing. Many thanks Jon import threading import sys import time global g_datum

Re: Pyparsing Question.

2006-11-23 Thread Ant
Welcome to pyparsing! The simplest way to implement a markup processor in pyparsing is to define the grammar of the markup, attach a parse action to each markup type to convert the original markup to the actual results, and then use transformString to run through the input and do the

select() on WinXP

2006-11-23 Thread [EMAIL PROTECTED]
I'm running Python 2.5 on Windows XP. When I try to do this: [code] import select select.select([], [], []) [/code] I get this: [output] Traceback (most recent call last): File C:/Documents and Settings/Grebekel/Desktop/s.py, line 2, in module select.select([],[],[]) error: (10022, 'An

Re: ImportError: No module named getopt

2006-11-23 Thread prashant
Thanks for the reply, I am actually using Cygwin to run a python script. I have python 2.5 installed. But when i ran the command mentioned by you... I see that it is looking in the wrong directories... how can i change these look up directories? Fredrik Lundh wrote: prashant wrote: I am

Re: select() on WinXP

2006-11-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: I'm running Python 2.5 on Windows XP. When I try to do this: [code] import select select.select([], [], []) [/code] I get this: [output] Traceback (most recent call last): File C:/Documents and Settings/Grebekel/Desktop/s.py, line 2, in module

Does only emacs and idle support symbolic debugging?

2006-11-23 Thread Victor Ng
Subject line pretty much says it all - are those the only two editors that support running the symbolic debugger from inside the editor? vic -- Never attribute to malice that which can be adequately explained by stupidity. - Hanlon's Razor --

Re: ImportError: No module named getopt

2006-11-23 Thread Fredrik Lundh
prashant wrote: I am actually using Cygwin to run a python script. I have python 2.5 installed. But when i ran the command mentioned by you... I see that it is looking in the wrong directories... how can i change these look up directories? is PYTHONHOME perhaps set to the wrong thing? if

[ANN] pylint 0.12.2 / astng 0.16.3

2006-11-23 Thread Sylvain Thénault
Hi there ! I'm pleased to announce new bugs fix releases of pylint and astng. Most bug discussed more or less recently on the python-projects mailing list should be fixed by those releases, and astng inference capability has been enhanced for some construction, so upgrade is recommended. Visit

Re: Does only emacs and idle support symbolic debugging?

2006-11-23 Thread Diez B. Roggisch
Victor Ng wrote: Subject line pretty much says it all - are those the only two editors that support running the symbolic debugger from inside the editor? Nope, eric for example does as well. And I presume komodo will do that also. Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: What's going on here?

2006-11-23 Thread Dale Strickland-Clark
Thanks for the answers. I am informed but I don't feel enlightened. It does strike me as odd that an apparently empty subclass should add extra function to the base class. Not at all obvious. -- Dale Strickland-Clark We are recruiting Python programmers. Please see the web site. Riverhall

Re: ldapsearch example in python-ldap?

2006-11-23 Thread Michael Ströder
Nico Grubert wrote: on a linux machine I am running this ldapsearch from the command line: ldapsearch -x -h myldaphost.mydomain.com \ -D CN=ldapuser,CN=Users,DC=mydomain,DC=com -w secret \ -b CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com How can I do this with python-ldap?

Re: select() on WinXP

2006-11-23 Thread [EMAIL PROTECTED]
I'm using it for sockets, it works on linux but not on Windows. The actual code is something like (server side): r, w, e = select.select(self.clients, [], self.clients, 5) where self.clients is a list of accepted sockets. -- http://mail.python.org/mailman/listinfo/python-list

Re: select() on WinXP

2006-11-23 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: I'm using it for sockets, it works on linux but not on Windows. The actual code is something like (server side): r, w, e = select.select(self.clients, [], self.clients, 5) where self.clients is a list of accepted sockets. The docs for select.select say: Empty

Re: ImportError: No module named getopt

2006-11-23 Thread prashant
thanks a lot that helped... Fredrik Lundh wrote: prashant wrote: I am actually using Cygwin to run a python script. I have python 2.5 installed. But when i ran the command mentioned by you... I see that it is looking in the wrong directories... how can i change these look up

Re: Abelson and Python

2006-11-23 Thread Scott David Daniels
markscottwright wrote: Fredrik Lundh wrote: markscottwright wrote: If it were that easy, the PyPy guys would be done by now. if the PyPy guys had focused on writing a Python interpreter in Python, they'd been done by now. /F Isn't that the point of PyPy? It's what their mission

Re: select() on WinXP

2006-11-23 Thread [EMAIL PROTECTED]
I patched the code to: if self.clients: r, w, e = select.select(self.clients, [], self.clients, 5) It works now, thank you Thomas :) -- http://mail.python.org/mailman/listinfo/python-list

Re: What's going on here?

2006-11-23 Thread robert
Dale Strickland-Clark wrote: Thanks for the answers. I am informed but I don't feel enlightened. It does strike me as odd that an apparently empty subclass should add extra function to the base class. Not at all obvious. Yes. As said, there is missing a __builtin__.Object object is not

Re: Does only emacs and idle support symbolic debugging?

2006-11-23 Thread Bytter
PyScripter (windows only) here: http://mmm-experts.com/Products.aspx?ProductId=4 On Nov 23, 4:00 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Victor Ng wrote: Subject line pretty much says it all - are those the only two editors that support running the symbolic debugger from inside the

Re: Simple threading

2006-11-23 Thread jrpfinch
many thanks - works perfectly now -- http://mail.python.org/mailman/listinfo/python-list

Re: How to sort list

2006-11-23 Thread Michael J. Fromberger
In article [EMAIL PROTECTED], Lad [EMAIL PROTECTED] wrote: I have a list of emails and I would like to sorted that list by domains E.g. If the list is Emails=['[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]','[EMAIL PROTECTED]',] after sorting I would like to have

Python business software?

2006-11-23 Thread Greg Lindstrom
Hello- My wife runs a sewing/embroidery business and has asked me to write a system to help her with her client database, inventory, and accounts receivable/payable. I've looked into using either PythonCard or Dabo (I like both packages) but thought I ask the list if there is anything like this

python gaining popularity according to a study

2006-11-23 Thread [EMAIL PROTECTED]
http://www.tiobe.com/index.htm?tiobe_index Python is the 7th most commonly used language, up from 8th. The only one gaining ground besides VB in the top 10. We're glad, our app is written in python. It's free at http://pnk.com and it is a web timesheet for project accounting --

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: 4) [] and {} always create a new object every time they're evaluated. Not quite. The empty tuple is cached: a = () b = () a is b True Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: len(var) is [CONSTANT] equal to len(var) == [CONSTANT]?

2006-11-23 Thread Fredrik Lundh
Brian Quinlan wrote: 4) [] and {} always create a new object every time they're evaluated. Not quite. The empty tuple is cached: a = () b = () a is b True () isn't [] or {}, though. time to switch to a bigger font? ;-) /F -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python Papers Edition One

2006-11-23 Thread Klaas
Tennessee writes: * If you say LaTex, I'll eat your brain. Or my hat. Unless I'm seriously underrating it, but I don't think so. Why? It is a suitable solution to this problem. You can produce unformatted content, then produce pdf and html pages from it. -Mike --

Python work in UK

2006-11-23 Thread Will McGugan
Hi, I'd love to work in Python, for the sake of my blood pressure, but there doesnt seem to be that many jobs that look for Python as the main skill. I use Python at work from time to time, and occasionaly get to spend several days on a Python project but the majority of the time I use C++.

Python 2.5 idle and print command How do I suppress a line feed?

2006-11-23 Thread notejam
Hi, I am having a problem with print statements always cause a line feed. I need to print a line of text, then the next print statement will start printing where the last one stopped rather than drop down a line. In basic we can do this with print texst; followed by next command print text2 So

Re: Trying to understand Python objects

2006-11-23 Thread Bruno Desthuilliers
Aahz a écrit : In article [EMAIL PROTECTED], Ben Finney [EMAIL PROTECTED] wrote: Typically, classes are created as a subclass of another class. The top-level basic type in Python is 'object', so if your class doesn't make sense deriving from anything else, derive from 'object'. class

Re: Python 2.5 idle and print command How do I suppress a line feed?

2006-11-23 Thread Will McGugan
notejam wrote: Hi, I am having a problem with print statements always cause a line feed. I need to print a line of text, then the next print statement will start printing where the last one stopped rather than drop down a line. In basic we can do this with print texst; followed by next

Re: Python 2.5 idle and print command How do I suppress a line feed?

2006-11-23 Thread Will McGugan
notejam wrote: Hi, I am having a problem with print statements always cause a line feed. I need to print a line of text, then the next print statement will start printing where the last one stopped rather than drop down a line. In basic we can do this with print texst; followed by next

Re: python gaining popularity according to a study

2006-11-23 Thread bearophileHUGS
[EMAIL PROTECTED]: Python is the 7th most commonly used language, up from 8th. The only one gaining ground besides VB in the top 10. It also shows that Ruby is gaining even more, and D is (gladly) growing too. Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to understand Python objects

2006-11-23 Thread George Sakkis
Bruno Desthuilliers wrote: AFAIK, everything you do with old-style classes can be done with new-style ones. The only thing I occasionally (or rather rarely) miss about old-style classes is instance-specific special methods: class C: ... def __init__(self,x): ... self.__getitem__

  1   2   >