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

2006-11-23 Thread Peter Otten
Andy wrote: > This works well as a checking strategy, but what I want is a suggesting > list... Indeed, I was grossly misreading your question. Peter -- http://mail.python.org/mailman/listinfo/python-list

call python with python extension in c

2006-11-23 Thread 放茗 谈
hello all, i am a newcomer, and i bring a quesition here: how can i call python app with wxPython/other python extensions in c? here is my code here,though not smart,it can explain myself to some extent,in addition,pls forgive me not checking the return value after each calling PyRun_SimpleSt

Re: beginner question about range with list and list

2006-11-23 Thread Fredrik Lundh
erik gartz wrote: > I'm new to python and I'm having difficulty understanding the following > code. Why doesn't the variable a contain [[{}, {'x': 0}, {}], [{}, > {'x': 1}, {}]] instead. Doesn't {} allocate new memory for the > dictionary each time? each time it's *executed*, yes. [{}]*3 doesn'

Re: Porting Tkinter application to JYthon

2006-11-23 Thread Godson
On 11/23/06, sandip desale <[EMAIL PROTECTED]> wrote: Dear All, We have a Tcl/Tk application written using Python 2.2. Using this application we want to call some customizable Java APIs. I tried porting Tcl/Tk application to Jython but not able to do the same as TKinter library is not available

Re: Access to variable from external imported module

2006-11-23 Thread Fredrik Lundh
GinTon wrote: > Thanks Robert, the best solution is get all local variables, else is > impossible access to them. if you don't want them to be local, why are you using local variables? (have you read the Python tutorial?) -- http://mail.python.org/mailman/listinfo/python-list

Re: The Python Papers Edition One

2006-11-23 Thread Jacques Naude
kilnhead wrote: > 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 Jour

Re: beginner question about range with list and list

2006-11-23 Thread Dan Lenski
erik gartz wrote: > Doesn't {} allocate new memory for the > dictionary each time? It almost appears as if the 2nd dictionary > created overwrites the first one. Thanks for your help, > Erik > > >>> > >>> a = [[{}] * 3] * 2 > >>> a > [[{}, {}, {}], [{}, {}, {}]] > >>> for i in range(2): > a[

Re: beginner question about range with list and list

2006-11-23 Thread Ben Finney
"erik gartz" <[EMAIL PROTECTED]> writes: > Doesn't {} allocate new memory for the dictionary each time? It > almost appears as if the 2nd dictionary created overwrites the first > one. http://effbot.org/pyfaq/how-do-i-create-a-multidimensional-list.htm> -- \"There are only two ways

beginner question about range with list and list

2006-11-23 Thread erik gartz
Hello, I'm new to python and I'm having difficulty understanding the following code. Why doesn't the variable a contain [[{}, {'x': 0}, {}], [{}, {'x': 1}, {}]] instead. Doesn't {} allocate new memory for the dictionary each time? It almost appears as if the 2nd dictionary created overwrites the f

Re: The Python Papers Edition One

2006-11-23 Thread [EMAIL PROTECTED]
> I thought I just had. In what way does the statement "Yes, it's true > that you can't resell copies of The Python Papers for personal profits, > but you may derive from it, reproduce and propagate it" not provide > such a revision and clarification? Seriously, let me know what exact > statement

Re: The Python Papers Edition One

2006-11-23 Thread [EMAIL PROTECTED]
Ben Finney wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > > > Yes, it's true that you can't resell copies of The Python Papers for > > personal profits, but you may derive from it, reproduce and > > propagate it. You're quite right to point it out. > > Then please revise the false stat

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

2006-11-23 Thread Andy
This works well as a checking strategy, but what I want is a suggesting list... Maybe what I want is not practical at all? Thanks anyway Peter. Andy Wu Andy ��道: > The seems good to me, I'll try it out, thanks for the posting. > > > "Peter Otten 写道: > " > > Andy wrote: > > > > > I'm trying to

Re: What's going on here?

2006-11-23 Thread Carl Banks
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. Remember that a class definition is syntax sugar for a direct cal

Re: About alternatives to Matlab

2006-11-23 Thread Phil Schmidt
Brian Blais wrote: > So my recommendation for a (nearly) complete Matlab replacement would be: > python > numpy > scipy > matplotlib > pyrex > Brian, Thanks for that list. I'm currently in the process of getting quotes for a bunch of Matlab tools for hardware-in-th

Re: Trying to understand Python objects

2006-11-23 Thread Carl Banks
Aahz wrote: > 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'.

Re: The Python Papers Edition One

2006-11-23 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Yes, it's true that you can't resell copies of The Python Papers for > personal profits, but you may derive from it, reproduce and > propagate it. You're quite right to point it out. Then please revise the false statement that the publication is "

Text markup conventions (was: sys.stderr.write and sys.exit)

2006-11-23 Thread Ben Finney
Dennis Lee Bieber <[EMAIL PROTECTED]> writes: > Ben Finney wrote: > > (Note: The underscore '_' is a valid character in Python code, so > > I was quite confused by what you wrote and had to read it several > > times to see that you were intending the underscores not to be > > part of the code. Bet

reading id3 tags with python

2006-11-23 Thread jeff
i stated using a python module called id3reader (http://www.nedbatchelder.com/code/modules/id3reader.html) and i tried to use it to organize all my music files (right now they are all in one folder (i want them in Music/artist/album/title.mp3)) but im getting an error with the code, however it does

The Python Papers -- letters to the editor

2006-11-23 Thread [EMAIL PROTECTED]
If anyone would like their comments to appear in The Python Papers, we will need to get your permission to use them under the Creative Commons 2.5 license subject to Noncommercial, Attribution and Share-Alike conditions. For this reason, we request that letters to the editor be emailed to [EMAIL PR

Re: [ANN] pylint 0.12.2 / astng 0.16.3

2006-11-23 Thread Colin J. Williams
Sylvain Thénault wrote: > 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,

Re: sys.stderr.write and sys.exit

2006-11-23 Thread GinTon
Thanks Ben Finney. So it's understood very well. Ben Finney ha escrito: > "GinTon" <[EMAIL PROTECTED]> writes: > > > Is the same use >>>>> sys.stderr.write('error message'); sys.exit(1) > > than >>>>> sys.exit('error message') ? > > Code that wants to catch SystemExit will get a different

SQLite3__Python2.3-SQLite__Problem

2006-11-23 Thread Cousin Stanley
It's been almost 2 years since I've done anything with Python and SQLite and I'm having some problems that I don't recall from my last usage It seems that SQLite3 data bases created at the command line and those created using the sqlite module from within Python are no longer c

Re: Access to variable from external imported module

2006-11-23 Thread GinTon
Thanks Robert, the best solution is get all local variables, else is impossible access to them. robert ha escrito: > GinTon wrote: > > I would to access to values that are created locally in that method > > after the method has executed? usually the return value? > or you want to get all local var

Re: The Python Papers Edition One

2006-11-23 Thread Paul Boddie
Klaas wrote: > 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. Sure, LaT

Re: The Python Papers Edition One

2006-11-23 Thread Stephen Hansen
Perhaps people could comment on the following proposition -- if an organisation is Not for Profit, its dealings are therefore Noncommercial? I think the problem is Python has historically been so very free-- It has always been *extremely* Business-Friendly, and totally lacks ... ah, the moral o

Re: Access to variable from external imported module

2006-11-23 Thread jim-on-linux
GinTon, I think this is what you want. class Kdoi:    def __init__(self) :            self.Fdo()    def Fdo(self): searchterm = 'help' print searchterm #local      self.searchterm = searchterm      print self.searchterm #used inside the class      Kdo.searchterm = searchterm

proof of concept python and tkinter gnugo interface

2006-11-23 Thread Anton Vredegoor
For the last few days I've been doodling with a script that provides a graphical interface to gnugo by using its GTP protocol. At the moment the script is *very* basic, in fact the only thing it does is to allow one to click on a coordinate and place a move there OR press the space bar in order

PDF to HTML conversion for The Python Papers

2006-11-23 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > The adobe people have online conversion > > http://www.adobe.com/products/acrobat/access_onlinetools.html > > google seems to convert them when they end up in the engines > > http://www.google.com/search?hl=en&q=pdf+to+html > > has a list of converters > > http://www.dex

Re: The Python Papers Edition One

2006-11-23 Thread [EMAIL PROTECTED]
Yes, it's true that you can't resell copies of The Python Papers for personal profits, but you may derive from it, reproduce and propagate it. You're quite right to point it out. Licenses are too complicated. I don't believe a license exists which meets the demands of all clients, however should I

Re: Access to variable from external imported module

2006-11-23 Thread Bruno Desthuilliers
GinTon a écrit : > Sorry, I mean access to local variable from a method One of the most surprising properties of local variables is that they are, well... local. -- http://mail.python.org/mailman/listinfo/python-list

Re: Access to variable from external imported module

2006-11-23 Thread Bjoern Schliessmann
GinTon wrote: > Sorry, I mean access to local variable from a method > > import module > method(value) That's no access to a local variable of a method. It's a simple function call. > I would to access to values that are created locally in that > method Something with your interface seems hor

Re: sys.stderr.write and sys.exit

2006-11-23 Thread Ben Finney
"GinTon" <[EMAIL PROTECTED]> writes: > Is the same use _sys.stderr.write('error message'); sys.exit(1)_ > than _sys.exit('error message')_ ? (Note: The underscore '_' is a valid character in Python code, so I was quite confused by what you wrote and had to read it several times to see that you we

Re: Access to variable from external imported module

2006-11-23 Thread robert
GinTon wrote: > Sorry, I mean access to local variable from a method > > import module > method(value) > > I would to access to values that are created locally in that method after the method has executed? usually the return value? or you want to get all local variables, then make a func/method

Re: Trying to understand Python objects

2006-11-23 Thread Bruno Desthuilliers
Fredrik Lundh a écrit : > Bruno Desthuilliers wrote: > >> Don't see it as a religious point please, but I fail to understand why >> you seem so in love with old-style classes ? (snip) > > to pick a few reasons: the old-style/new-style distinction is com- > pletely irrelevant for people new to t

Re: Access to variable from external imported module

2006-11-23 Thread GinTon
Sorry, I mean access to local variable from a method import module method(value) I would to access to values that are created locally in that method Fredrik Lundh ha escrito: > GinTon wrote: > > > How to access to a variable (that value is not returned) from a module > > imported? > > And the v

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

2006-11-23 Thread Tim Roberts
Tor Erik Soenvisen <[EMAIL PROTECTED]> 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=

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

2006-11-23 Thread Graham Dumpleton
Paul Boddie wrote: > 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

Re: Is time.time() < time.time() always true?

2006-11-23 Thread Tim Roberts
"Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: >"flamesrock" <[EMAIL PROTECTED]> wrote: > >8<-- > >> since the statement itself >> occurs at one time instant.. > >nothing, but nothing, can occur at one time instant Well, as long as we're being pedantic, s

Re: Access to variable from external imported module

2006-11-23 Thread Fredrik Lundh
GinTon wrote: > How to access to a variable (that value is not returned) from a module > imported? > And the variable is set at the module-level. import module print module.variable (have you read the Python tutorial?) -- http://mail.python.org/mailman/listinfo/python-list

Access to variable from external imported module

2006-11-23 Thread GinTon
How to access to a variable (that value is not returned) from a module imported? And the variable is set at the module-level. That module is external to my program, it's from another project so I wann't modifying it. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-11-23 Thread Brian Quinlan
Fredrik Lundh wrote: > 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? ;-) Yeah, sorr

Re: Trying to understand Python objects

2006-11-23 Thread Fredrik Lundh
Bruno Desthuilliers wrote: > Don't see it as a religious point please, but I fail to understand why > you seem so in love with old-style classes ? new-style classes are the > "official" Python object model since 2.2 (which is a few years ago now), > and the last mandatory use of them (exception

Re: python gaining popularity according to a study

2006-11-23 Thread robert
[EMAIL PROTECTED] wrote: > 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 p

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

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

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

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

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"

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++. Ho

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 -- http://mail.python.org

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? ;-) -- http://mail.python.org/mailman/listi

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

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 -- http://mail.pyth

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

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

Re: Simple threading

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

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

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 i

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: 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. >> >> > > Isn't that the point of PyPy? It's what t

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

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

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 Syst

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

[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 th

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?

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 -- http://mail.python.org/mailman/listinfo/python-li

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

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

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 select.select([],[],[]) error: (10022, 'An invalid

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 conv

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

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

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

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 g_raw

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 c

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

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

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

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

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

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') >mess

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(

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 looking

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

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(bod

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

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

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 framewo

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: Porting Tkinter application to JYthon

2006-11-23 Thread Tim N. van der Leeuw
Hi, sandip desale wrote: > Dear All, > > We have a Tcl/Tk application written using Python 2.2. Using this application > we want to call some customizable Java APIs. I tried porting Tcl/Tk > application to Jython but not able to do the same as TKinter library is not > available with JYthon. > >

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 -- http://mail.python.org/mailm

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

  1   2   >