OOPS concept

2005-05-04 Thread km
Hi all, Is there any good step by step online tutorial on OOPS concepts in python ? i have checked some on the python.org.__doc__ page but couldnt make much sense. especially i need help on newstyle classes. regards, KM -- http://mail.python.org/mailman/listinfo/python-list

Re: Py2Exe security

2005-05-04 Thread mahasamatman
I suggest You to use base 64 encoded strings something like password = 'aGlkZGVuX3Bhc3N3b3Jk\n' password = pasword.decode("base64") -- http://mail.python.org/mailman/listinfo/python-list

How To Reply

2005-05-04 Thread phil
I get a digest several times a day. When I wish to respond to an item I must cut and paste the item and the subject line. Is there something to click on for a simple reply? Using an old mozilla mail. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Creating Files

2005-05-04 Thread Dan
I know how to open a system file with Python, but is there some way to create one if it's not there? Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Mod_python

2005-05-04 Thread Dan
On 3 May 2005 19:22:52 -0700, "Gensek" <[EMAIL PROTECTED]> wrote: >I want to use mod_python, but I'm having trouble. Here's what I have in >my config: I've been using cherrypy (cherrypy.org) instead of apache with mod_python. In a lot of cases, apache is overkill. With cherrypy you can build a

Re: OOPS concept

2005-05-04 Thread monkey
Try this online book, it may help, the url is: http://www.byteofpython.info > Hi all, > > Is there any good step by step online tutorial on OOPS concepts in python ? > i have checked some on the python.org.__doc__ page but couldnt make much sense. especially i need help on newstyle classes. > >

Re: wxpython on cygwin for drPython - ImportError: No module named _core_

2005-05-04 Thread monkey
I install the original python(www.python.org), it works with wxpython and DrPython very very well. But your case seem to be due to DrPython is not programed for Cygwin. You should read through the system requirement of DrPython. As remember, it stated the www.python.org only ( ; > Hi, > > Did some

Re: PHPParser pod Zope

2005-05-04 Thread Josef Meile
George Sakkis wrote: > Bruno Desthuilliers wrote: > >>JZ a Ãcrit : >> >>>Probuje zainstalowac modul php pod zope i tam napisali dziwna rzecz > > ze > >>>potrzebuje "PHP CGI program" a nie PHP CLI. Kompilacja php 5.0.4 > > pod > >>>linuksem daje mi w wyniku mod_php + 5 plikow binarnych: pear, p

Re: PHPParser pod Zope

2005-05-04 Thread Peter Otten
Josef Meile wrote: [Non-English/non-Polish answers to a post in Polish] > I don't find this two replies funy :-(. I think it is impolite to make > fun of the OP. You could say: "The official language is english" or > something like that. And if somebody knows the language he speaks, then > a poin

Re: file parsing/watching + qt

2005-05-04 Thread Phil Thompson
> this is a Qt app. app should watch for changes in /var/log/isdn.log and > on file change (like new line was added to isdn.log) it should activate > event in my app. > > i'm trying to fetch last line in file whenever isdnlog logs something > so that i can parse that line for a number and store it

Re: PHPParser pod Zope

2005-05-04 Thread Peter Otten
George Sakkis wrote: > ÎÏÎ Î ÎÏÏÏÎÎÏÎ ÎÎÏÎÏÏÎÏÎ ÏÎÏÎÎ ÏÎ > ÎÎÏÎÎÎÏ ÏÏ, Î ÎÎÎ ÎÎ ÏÎÏÎÎ > ÎÏÏÏ Î ÎÏÏ Î ÎÏÎÎÏ ÎÏ > ÎÏÎÏÎÎÎÏ ÏÏÎ ÎÎÏÏÎ... Yeah, spreading that ole SCO source code again... Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating Files

2005-05-04 Thread bruno modulix
Dan wrote: > > I know how to open a system file with Python, but is there some way to > create one if it's not there? As in any other language I know : just open it in write mode !-) -- bruno desthuilliers python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in '[EMAIL PR

Re: PHPParser pod Zope

2005-05-04 Thread Max M
Peter Otten wrote: > Josef Meile wrote: > > [Non-English/non-Polish answers to a post in Polish] > >>I don't find this two replies funy :-(. I think it is impolite to make >>fun of the OP. You could say: "The official language is english" or >>something like that. And if somebody knows the langua

Re: How to write this regular expression?

2005-05-04 Thread George Sakkis
This newsgroup is in general very helpful, but there are some exceptions; one of them is when the problem appears blatantly to be a homework. Perhaps if you showed that you worked on it and made some progress, but it's not quite right, someone may help you. George -- http://mail.python.org/mailm

Re: PHPParser pod Zope

2005-05-04 Thread bruno modulix
Josef Meile wrote: (snip) > > I don't find this two replies funy :-(. I think it is impolite to make > fun of the OP. My intent was not to make fun *of* the OP. Now I'm willing to admit that my answer may not be as (kindly) funny as intended, and so I hope the OP has a better sens of humor tha

_RE: Mod_python

2005-05-04 Thread Paul Boddie
Gensek wrote: > > I want to use mod_python, but I'm having trouble. Here's what I have in > my config: > > LoadModule python_module /usr/local/apache2/modules/mod_python.so > > > AddHandler mod_python .py > PythonHandler mptest > PythonDebug On > My guess is that you need to add an A

Re: PHPParser pod Zope

2005-05-04 Thread George Sakkis
"bruno modulix" <[EMAIL PROTECTED]> wrote: > Josef Meile wrote: > (snip) > > > > I don't find this two replies funy :-(. I think it is impolite to make > > fun of the OP. > > My intent was not to make fun *of* the OP. Now I'm willing to admit that > my answer may not be as (kindly) funny as intend

Re: How to write this regular expression?

2005-05-04 Thread could ildg
Does it matter whether it is a homework? Why do you look down upon homework? Everyone can do his homework well without any problems in your logic? It's a problem I met. I tried a lot and I can't work it out, so I came here for help. I saw someone complained that a question is too lengthy, and I saw

Re: Creating Files

2005-05-04 Thread Dan
On Wed, 04 May 2005 10:24:23 +0200, bruno modulix <[EMAIL PROTECTED]> wrote: >As in any other language I know : just open it in write mode !-) Easy when you know how. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: twisted jabber and xmlstream

2005-05-04 Thread Sylvain Thenault
On Tue, 03 May 2005 17:05:46 +, Operation Latte Thunder wrote: > I am playing around with Jabber with Twisted. I can receive messages just > fine, and thats great, however, I am a bit confused about how to actually > _send_ messages. From what I've seen, I need to call send() on the > xmlstr

Re: How to write this regular expression?

2005-05-04 Thread Heiko Wundram
On Wednesday 04 May 2005 11:34, could ildg wrote: > Does it matter whether it is a homework? Yes, it does matter. We're not your CS-class homework monkeys... :-) We're a forum of Python programmers who aid each other at thinking about solutions, we don't present solutions (normally), for a beaut

Better way to do parsing?

2005-05-04 Thread André Roberge
Hi all, I posted the following on the python tutor list 3 days ago ... and haven't heard a peep from anyone - which is highly unusual on that list. [Apologies for the slightly longer post due to code with tests cases included at the end .] I have created a "severely restrict

Re: file parsing/watching + qt

2005-05-04 Thread Swaroop C H
On 3 May 2005 22:43:02 -0700, aljosa <[EMAIL PROTECTED]> wrote: > i'm trying to fetch last line in file whenever isdnlog logs something > so that i can parse that line for a number and store it somewhere else, > is there a standard solution for this? > i'm using python2.3 on linux with PyQt3. Use

Re: py2exe and library.zip

2005-05-04 Thread Simon Brunning
On 5/3/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > exactly what i just stated, i don't want py2exe to zip up it's > library's, but to put them in a sub dir. > the reason for this, is so that when users login and update from svn, > they only have to download some tiny pyc files, not a great big z

Re: How to write this regular expression?

2005-05-04 Thread Antoon Pardon
Op 2005-05-04, could ildg schreef <[EMAIL PROTECTED]>: > Does it matter whether it is a homework? Yes, because if other do your homework for you, you wont have learned anything from it. > Why do you look down upon homework? Who says he does. That he is not willing to do your homework for you, do

Re: py2exe and library.zip

2005-05-04 Thread Simon Brunning
On 5/4/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > Simon Brunning wrote: > >The zip file is a generated artifact. I've always found it a good rule > >of thumb that you should keep source artifacts in your version control > >system, not generated artifacts. > > > > > > > version control systems a

sha-2 and sha-512 bindings

2005-05-04 Thread Almad
Hi, is there any python bindings for sha-2 or sha-512? Pycrypto seems to have only sha-1 bindings and I can't see any other package on net... Thanks, -- Lukas "Almad" Linhart [:: http://www.almad.net/ ::] [:: Humans are too complicated to be described with words. ::] [:: PGP/GNUPg key: http

Re: py2exe and library.zip

2005-05-04 Thread Timothy Smith
Simon Brunning wrote: >On 5/4/05, Timothy Smith <[EMAIL PROTECTED]> wrote: > > >>Simon Brunning wrote: >> >> >>>The zip file is a generated artifact. I've always found it a good rule >>>of thumb that you should keep source artifacts in your version control >>>system, not generated artifacts.

Re: Creating Files

2005-05-04 Thread Terje Johan Abrahamsen
Dan wrote: > On Wed, 04 May 2005 10:24:23 +0200, bruno modulix <[EMAIL PROTECTED]> > wrote: > > >As in any other language I know : just open it in write mode !-) > > Easy when you know how. > > Thanks e = file('c:/file.txt', 'w') By the way, check out the Python tutor service... http://mail.pyth

Re: Regular Expression tools?

2005-05-04 Thread Terje Johan Abrahamsen
This is what you are looking for. http://kodos.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with pyXML DOM

2005-05-04 Thread Maniac
Florian Lindner wrote: >Traceback (most recent call last): > File "ConfigReader.py", line 40, in ? >c = ConfigReader(f) > File "ConfigReader.py", line 32, in __init__ >print sourceNode.getElementsByTagName("filename")[0].nodeValue() >TypeError: 'NoneType' object is not callable > > Thi

Difference between Python CGI applications and Php applications

2005-05-04 Thread praba kar
Dear all, I have a project that is conversion of Php Web applications into Python cgi applications. In my mind compare python-cgi php is better. But I want to know clearly. which one is better. so kindly show me the advantages of python-cgi compare to Php regards PRaba __

Re: twisted jabber and xmlstream

2005-05-04 Thread Operation Latte Thunder
Sylvain Thenault <[EMAIL PROTECTED]> wrote: > you can find some examples in our fatima project, a jabber bot testing > client, available at http://www.logilab.org/projects/fatima/0.1 > You'll find a jabber.py module in the distribution containing jabber > related code. > > hope that helps thanks,

Problems calling cdrdao from python 2.3

2005-05-04 Thread Jeremy Wilkins
Hi all, I'm trying to use popen3 to call cdrdao from within python, it gets half way through though then hangs. This is easy to replicate from the interpreter. import popen2 child = popen2.Popen3('cdrdao disk-info --device 0,0,0'.split(' '), 1, 100) child.fromchild.read() The above code works f

Re: py2exe and library.zip

2005-05-04 Thread Peter Hansen
Timothy Smith wrote: > Peter Hansen wrote: >> Anything's possible. Maybe you could explain what you're actually >> trying to accomplish (or the reasons) so we can better understand >> where you're going with this... >> > exactly what i just stated, i don't want py2exe to zip up it's > library's

Re: How to write this regular expression?

2005-05-04 Thread Peter Hansen
could ildg wrote: > I need a regular expression to check if a string matches it. Why do you think you need a regular expression? If another approach that involved no regular expressions worked much better, would you reject it for some reason? -Peter -- http://mail.python.org/mailman/listinfo/p

Re: How To Reply

2005-05-04 Thread Peter Hansen
phil wrote: > I get a digest several times a day. > When I wish to respond to an item I must > cut and paste the item and the subject line. > Is there something to click on for a simple reply? > Using an old mozilla mail. You are forced to cut and paste if you want to get the messages in a digest

Re: Problem with pyXML DOM

2005-05-04 Thread Florian Lindner
Maniac wrote: > Florian Lindner wrote: > >>Traceback (most recent call last): >> File "ConfigReader.py", line 40, in ? >>c = ConfigReader(f) >> File "ConfigReader.py", line 32, in __init__ >>print sourceNode.getElementsByTagName("filename")[0].nodeValue() >>TypeError: 'NoneType' object

Re: Regular Expression tools?

2005-05-04 Thread Kent Johnson
Lee Cullens wrote: > Been here before, but can't remember what I used and anyway that was a > PC platform. > > So, if you use a Regular Expression tool (PCRE standard) for Python > programming and your development platform is Mac OS X, would you please > help narrow down the search for me. All

Re: Form and Database

2005-05-04 Thread bruno modulix
v wrote: > Please help. I'm new with Python. > Using Boa (or Pythoncard) and pysqlite, how can I read/write from/to > database, thanks First learn how to read/write data from your db (without any gui stuff). Then learn how to use your gui (without any db stuff). Then make the two working tog

Re: Regular Expression tools?

2005-05-04 Thread Lee Cullens
Tim Henderson: > I am not quite sure what you want. However if you are looking for > Python's regular expression module it is the re module. Just go to > interactive help and view the api for it. Thanks Tim, I found RegexPlor - not as full as I was thinking of, but it does the job. Lee C -- h

Re: Problem with pyXML DOM

2005-05-04 Thread Maniac
Florian Lindner wrote: >But I don't really understand the logic: > >given I have the node A > >path > >A.firstChild.nodeValue == path > >How would the second child of A look like? (ok, None in this case) > Yes. It's actually required by DOM standard: NodeList (which is returned from getElementsBy

Re: py2exe and library.zip

2005-05-04 Thread Timothy Smith
Peter Hansen wrote: >Timothy Smith wrote: > > >>Peter Hansen wrote: >> >> >>>Anything's possible. Maybe you could explain what you're actually >>>trying to accomplish (or the reasons) so we can better understand >>>where you're going with this... >>> >>> >>> >>exactly what i just st

tkinter and threads

2005-05-04 Thread Nir Aides
Hello, In Tkinter, is it safe to call widget.after(time, callback) from another thread (other than the gui thread)? Thanks, Nir -- http://mail.python.org/mailman/listinfo/python-list

Announcing CherryShell a python shell in your webbrowser

2005-05-04 Thread nopa90
A python interpreter embedded in a cherrypy webserver and controlled by webbrower. Powered by AJAX. Currently only version 0.10 and only works with firefox. http://john.thetrotter.net Also example of using cherrypy with AJAX (jsonrpc) -- http://mail.python.org/mailman/listinfo/python-list

Re: Read / Write image file

2005-05-04 Thread codecraig
so something like, x = sock.recv(1024) while (len(x) > 0): # do stuff x = sock.recv(1024) ?? So what if the client sends 4 bytes, and then sends 8000 bytes? WIll I get the first 4 bytes as a separate msg so to speak? Basically i want to catch each message from the client as a whole.

About Encapsulation

2005-05-04 Thread Adriano Monteiro
Hey folks, I wanna know more about encapsulation in python. Is it fully suported? How can I define the encapsulation statements for methods and attributes? Regards! []'s! -- Adriano Monteiro Marques www.gopython.com.br [EMAIL PROTECTED] I'm FREE... Are you? (PYTHON powered) -- http://mail.

Problem with pyXML DOM

2005-05-04 Thread Florian Lindner
Hello, I'm using the PyXML Package. My XML document looks like that: /home/florian/visualizer/testdata.csv print sourceNode.getElementsByTagName("filename")[0] print sourceNode.getElementsByTagName("filename")[0].nodeValue() gives: Traceback (most recen

Re: How to write this regular expression?

2005-05-04 Thread could ildg
I can tell you that this is not any homework at all, I think it by myself. I like this maillist, it helped me a lot. but some guys as you look weird. On 4 May 2005 10:25:20 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Op 2005-05-04, could ildg schreef <[EMAIL PROTECTED]>: > > Does it matter wh

Re: How to write this regular expression?

2005-05-04 Thread could ildg
Thank you. I just learned how to use re, so I want to find a way to settle it by using re. I know that split it into pieces will do it quickly. On 5/4/05, Peter Hansen <[EMAIL PROTECTED]> wrote: > could ildg wrote: > > I need a regular expression to check if a string matches it. > > Why do you

Re: Read / Write image file

2005-05-04 Thread Peter Hansen
codecraig wrote: > so something like, > > x = sock.recv(1024) > while (len(x) > 0): > # do stuff > x = sock.recv(1024) > > > ?? > > So what if the client sends 4 bytes, and then sends 8000 bytes? WIll I > get the first 4 bytes as a separate msg so to speak? Basically i want > to catch

Re: sha-2 and sha-512 bindings

2005-05-04 Thread rbt
Almad wrote: > Hi, > > is there any python bindings for sha-2 or sha-512? > > Pycrypto seems to have only sha-1 bindings and I can't see any other package > on net... > > Thanks, On Debian GNU\Linux Testing, Python2.3-crypto contains sha256 hashing. http://packages.debian.org/testing/python

Re: xmlrpclib and decoding entity references

2005-05-04 Thread Chris Curvey
yep, I'm using SimpleRPCServer, but something is getting messed up between the receipt of the XML stream and the delivery to my function. The "normal" entity references (like < and &) are handled OK, but the character references are not working. For instance, "André" is received by the server, bu

Re: Regular Expression tools?

2005-05-04 Thread Lee Cullens
From: "Terje Johan Abrahamsen" <[EMAIL PROTECTED]> Date: May 4, 2005 6:49:14 AM EDT To: python-list@python.org Subject: Re: Regular Expression tools? This is what you are looking for. http://kodos.sourceforge.net/ I've seen that and it looks great, but I don't have the Trolltech Qt applicat

Re: Difference between Python CGI applications and Php applications

2005-05-04 Thread Ville Vainio
> "Praba" == praba kar <[EMAIL PROTECTED]> writes: Praba> Dear all, Praba> I have a project that is conversion of Php Web applications Praba> into Python cgi applications. In my mind compare You might want to look into mod_python and psp (python server pages) for a more straight

Re: py2exe and library.zip

2005-05-04 Thread Just
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > [ ... ] (Note to self: check if zip files that can > be in sys.path can be compressed, Yes. > and if py2exe compresses them.) Don't know, but I assume yes. Just -- http://mail.python.org/mailman/listinfo/python-list

Re: About Encapsulation

2005-05-04 Thread Sébastien Boisgérault
You mean private, protected, public, that kind of stuff ? They do not exist in Python. Conventionally if you don't want the user of a class to access a method or attribute, you use the prefix _ ; class K(object): _a = 1 def __init__(self, val): self.arg = val self._hidde

Re: How To Reply

2005-05-04 Thread François Pinard
[Peter Hansen] > You are forced to cut and paste if you want to get the messages in a > digest. I doubt any mail program has been designed to know how to do > anything smarter, Lars Magne Ingebrigtsen's wonderful Gnus (a much boosted, combined news/mail reader, running within or over Emacs) kn

Re: How to write this regular expression?

2005-05-04 Thread vkeyboard
Personally I'd use groups. -- http://mail.python.org/mailman/listinfo/python-list

Re: control precision for str(obj) output?

2005-05-04 Thread Bo Peng
Dan Bishop wrote: > Andrew Dalke wrote: > >>Mike Meyer wrote: >> >>>Someone want to tell me the procedure for submitting FAQ entries, > > so I > >>>can do that for this? >> >>You mean more than what already exists at >> > > http://www.python.org/doc/faq/general.html#why-are-floating-point-calcu

ANN: Leo 4.3-b1

2005-05-04 Thread Edward K. Ream
Leo 4.3 beta 1 is now available at http://sourceforge.net/projects/leo/ Leo 4.3 beta 1 completes all major features of Leo 4.3. There are no known significant bugs. The defining features of Leo 4.3: - 1. Leo now stores options in @settings trees, that is, outline

Re: py2exe and library.zip

2005-05-04 Thread Thomas Heller
Timothy Smith <[EMAIL PROTECTED]> writes: > is it possible instead of py2exe putting all library's in a zip file, > to just put them in a sub dir? You can subclass the build_exe command (the extending sample shows how to do this, althoutgh for a different purpose), and copy the files into a sub d

Re: py2exe and library.zip

2005-05-04 Thread Thomas Heller
Just <[EMAIL PROTECTED]> writes: > In article <[EMAIL PROTECTED]>, > Peter Hansen <[EMAIL PROTECTED]> wrote: > >> [ ... ] (Note to self: check if zip files that can >> be in sys.path can be compressed, > > Yes. > >> and if py2exe compresses them.) > > Don't know, but I assume yes. There's an op

Re: How To Reply

2005-05-04 Thread Grant Edwards
On 2005-05-03, phil <[EMAIL PROTECTED]> wrote: > I get a digest several times a day. > When I wish to respond to an item I must > cut and paste the item and the subject line. > Is there something to click on for a simple reply? > Using an old mozilla mail. Instead of accessing the newsgroup throu

Python FAQ entries (Was: control precision for str(obj) output?)

2005-05-04 Thread Mike Meyer
"Dan Bishop" <[EMAIL PROTECTED]> writes: > Andrew Dalke wrote: >> Mike Meyer wrote: >> > Someone want to tell me the procedure for submitting FAQ entries, > so I >> > can do that for this? >> >> You mean more than what already exists at >> > http://www.python.org/doc/faq/general.html#why-are-float

Re: How To Reply

2005-05-04 Thread Mike Meyer
François Pinard <[EMAIL PROTECTED]> writes: > [Peter Hansen] > >> You are forced to cut and paste if you want to get the messages in a >> digest. I doubt any mail program has been designed to know how to do >> anything smarter, > > Lars Magne Ingebrigtsen's wonderful Gnus (a much boosted, combi

Re: tkinter and threads

2005-05-04 Thread Philippe C. Martin
I might be wrong, but my experience is to keep all tkinter calls in the main thread and use queues to have other threads tell the main one what to do. Regards, Philippe Nir Aides wrote: > Hello, > > In Tkinter, is it safe to call widget.after(time, callback) from another > thread (other than

Re: Better way to do parsing?

2005-05-04 Thread [EMAIL PROTECTED]
Isn't it a better idea to manipulate the import statement with use of of the 'imp' module to get a restriction on the import statement? -- http://mail.python.org/mailman/listinfo/python-list

SWIG/Python2.4.1: "ImportError: dynamic module does not define init function (initSHIP)"

2005-05-04 Thread Bill Davy
Hello, I am using SWIG-1.3.24 to make an extension (called SHIP) to Python2.4.1 and then running under IDLE (if that makes any difference) but when I "import SHIP" I get: >>> import SHIP Traceback (most recent call last): File "", line 1, in -toplevel- import SHIP ImportError: dynamic mo

Re: empty lists vs empty generators

2005-05-04 Thread Leif K-Brooks
Jeremy Bowers wrote: > def __init__(self, generator): > self.generator = generator You'll want to use iter(generator) there in order to handle reiterables. -- http://mail.python.org/mailman/listinfo/python-list

A faster method to generate a nested list from a template?

2005-05-04 Thread DJTB
Hi all, I'm new to Python. I'm trying to create a fast function to do the following: t = [['a1','a2'],['b1'],['c1'],['d1']] l = [1,2,3,4,5] >>> create_nested_list(t,l) [[1, 2], [3], [4], [5]] t is some sort of template. This is what I have now: def create_nested_list(template,l_orig): '''Us

Variable option count

2005-05-04 Thread Florian Lindner
Hello, how can I give an arbitrary number of options in a automated way to a function? Example. I've the list A = [ 1 2 3 ... ] Now I want to give this list to a function so that it is the same for function like: f(1, 2, 3, ...) How can I do that? Thanks, Flor

Re: Variable option count

2005-05-04 Thread Simon Brunning
On 5/4/05, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > how can I give an arbitrary number of options in a automated way to a > function? > > Example. > > I've the list A = > > [1, 2, 3] > > Now I want to give this list to a function so that it is the same for > function like: > > f(1

Re: A faster method to generate a nested list from a template?

2005-05-04 Thread Jeff Epler
Are there only a few, unchanging templates? If so, (dynamiclly) create a function for each template. This will be nearly the fastest you can go in Python, excluding the time to create and byte-compile the nesting function. # This code is in the public domain def make_nesting_expression(l, s):

descriptor dilemma

2005-05-04 Thread john
Hello, I was wondering if someone could explain the following situation to me please: >>> class C(object): def f(self): pass >>> c = C() >>> c.f > >>> C.__dict__['f'].__get__(c,C) > >>> c.f == C.__dict__['f'].__get__(c,C) True >>> c.f is C.__dict__['f'].__get__(c,C) False

Re: Better way to do parsing?

2005-05-04 Thread Bengt Richter
On Wed, 04 May 2005 07:13:22 -0300, =?ISO-8859-1?Q?Andr=E9_Roberge?= <[EMAIL PROTECTED]> wrote: >Hi all, > >I posted the following on the python tutor list 3 days ago ... and >haven't heard a peep from anyone - which is highly unusual on that list. > >[Apologies for the slightly longer post due

Re: Python & SQLite

2005-05-04 Thread Andy Jeffries
dcrespo wrote: > Does PySQLite run on Linux? Yes! >From my Gentoo laptop: andyvaio root # emerge -av pysqlite These are the packages that I would merge, in order: Calculating dependencies ...done! [ebuild R ] dev-python/pysqlite-0.5.1 0 kB Total size of downloads: 0 kB Do you want me to

Re: Better way to do parsing?

2005-05-04 Thread Paul McGuire
You asked for parsing, here's some pyparsing. Download pyparsing at http://pyparsing.sourceforge.net. -- Paul from pyparsing import * IMPORT = Keyword("import") AS = Keyword("as") FROM = Keyword("from") ident = Word(alphas+"_", alphanums+"_") import1 = Group( IMPORT + ident + Optional( AS + ide

ANN: CherryPy-2.0-final released

2005-05-04 Thread remi
Hello everyone, I am happy to announce the first stable release of CherryPy-2. CherryPy-2 is a pythonic, object-oriented web development framework. CherryPy-2 is a redesign of CherryPy-1 (the unpythonic features have been removed): no more compilation step, pure python source code (no more "Cher

Re: xmlrpclib and decoding entity references

2005-05-04 Thread Chris Curvey
Here is the solution. Incidentally, the client is Cold Fusion. import re import logging import logging.config import os import SimpleXMLRPCServer logging.config.fileConfig("logging.ini") class LoggingXMLRPCRequestHandler(S

New Zope Italia Association (AZI)

2005-05-04 Thread Stefano Noferi
We are pleased to announce the foundation of the Zope Italia Association (AZI - Associazione Zope Italia). It was created by a couple of mailing list users in the last months (since march). Main goals are to manage the Zope.IT community activities, to contribute to the diffusion and to improve th

Q: The `print' statement over Unicode

2005-05-04 Thread François Pinard
Hi, people. I hope someone would like to enlighten me. For any application handling Unicode internally, I'm usually careful at properly converting those Unicode strings into 8-bit strings before writing them out. However, this morning, I mistakenly forgot to do so before using one Unicode string

Re: Read / Write image file

2005-05-04 Thread Scott David Daniels
phil wrote: >> >> By the way, what is 'rb' and 'wb' ? >> > > Read Binary, Write Binary > In Win32 the default is text mode which > will screw up binary files > In fact, this is not just for Windows. Linux / Unix is unusual using the originally non-standards-conforming line feed ('\n') character

Re: Q: The `print' statement over Unicode

2005-05-04 Thread Thomas Heller
François Pinard <[EMAIL PROTECTED]> writes: > Hi, people. I hope someone would like to enlighten me. > > For any application handling Unicode internally, I'm usually careful > at properly converting those Unicode strings into 8-bit strings before > writing them out. > > However, this morning, I m

Re: Read / Write image file REC SEP

2005-05-04 Thread phil
>> >>So what if the client sends 4 bytes, and then sends 8000 bytes? WIll I >>get the first 4 bytes as a separate msg so to speak? Basically i want >>to catch each message from the client as a whole. >> IF YOU WANT SEPARATE MESSAGES: Modify the client to send an end of record, then: On Server:

Re: xmlrpclib and decoding entity references

2005-05-04 Thread Bengt Richter
On 3 May 2005 08:07:06 -0700, "Chris Curvey" <[EMAIL PROTECTED]> wrote: >I'm writing an XMLRPC server, which is receiving a request (from a >non-Python client) that looks like this (formatted for legibility): > > > >echo > > > >Le Martyre de Saint André
avec inscription >'Le Dominiquain.' et

postgresql plpython bug

2005-05-04 Thread Mage
Hello! create or replace function trigger_keywords_maintain() returns trigger as $$ return 'MODIFY' $$ language plpythonu; update table set id = id where id = 7; ERROR: invalid input syntax for type timestamp: "2005-05-03 14:07:33,279213" I see that Python's timestamp format is n

Re: descriptor dilemma

2005-05-04 Thread Sébastien Boisgérault
Yup ?!? Weird ... especially as: >>> id(c.f) == id(C.__dict__['f'].__get__(c,C)) True I was pretty sure that 'id(a) == id(b)' iff 'a is b' ... I thought initially that you had two *copies* of the same method bot obviously it's not true ... SB -- http://mail.python.org/mailman/listinfo/python

Re: descriptor dilemma

2005-05-04 Thread Jeff Epler
On Wed, May 04, 2005 at 09:14:18AM -0700, Sébastien Boisgérault wrote: > > Yup ?!? Weird ... especially as: > > >>> id(c.f) == id(C.__dict__['f'].__get__(c,C)) > True Here, c.f is discarded by the time the right-hand-side of == is executed. So the object whose id() is being calculated on the ri

How do you convert a string obj to a file obj?

2005-05-04 Thread Matthew Thorley
I'm writing a web app whereby a user uploads a tar acrhive which is then opened and processed. My web form reads the file like this: while 1: data = value.file.read(1024 * 8) # Read blocks of 8KB at a time if not data: break which leaves me with data as a string obj. The problem that I ha

Re: A faster method to generate a nested list from a template?

2005-05-04 Thread jasondrew72
Jeff Epler wrote: > Are there only a few, unchanging templates? If so, (dynamiclly) create > a function for each template. This will be nearly the fastest you can > go in Python, excluding the time to create and byte-compile the nesting > function. > > # This code is in the public domain > def m

Re: How do you convert a string obj to a file obj?

2005-05-04 Thread John Abel
Matthew Thorley wrote: >I'm writing a web app whereby a user uploads a tar acrhive which is then >opened and processed. My web form reads the file like this: > >while 1: >data = value.file.read(1024 * 8) # Read blocks of 8KB at a time >if not data: break > >which leaves me with data as a s

Re: descriptor dilemma

2005-05-04 Thread Peter Otten
john wrote: > Why do c.f and C.__dict__['f'].__get__(c,C) compare as equal under == > but not under *is* ? These variations are equivalent. Every attribute access gives you a new bound method: >>> class C(object): ... def f(self): pass ... >>> c = C() >>> c.f is c.f False >>> c.f == c.f Tr

zipimport

2005-05-04 Thread Gabriele *Darkbard* Farina
Hi, I have a zip file structured like this: mymodule.zip\ module1.py submodule\ submodule1.py I tried to load submodule.submodule1 using this pice of code: import zipimport z = zipimport.zipimporter("mymodule.zip") z.load_module("submodule.submodule1") but it does not work (load_mod

Re: How do you convert a string obj to a file obj?

2005-05-04 Thread Matthew Thorley
John Abel wrote: > Matthew Thorley wrote: > >> I'm writing a web app whereby a user uploads a tar acrhive which is then >> opened and processed. My web form reads the file like this: >> >> while 1: >>data = value.file.read(1024 * 8) # Read blocks of 8KB at a time >>if not data: break >> >>

FTP/TLS connection using python

2005-05-04 Thread scrimp
Hello, I was wondering if there is any other way to securly connect to an FTP site using SSL or TLS? I dont have the option of purchasing M2Crypto from the site. Any help/suggestions would help. Thanks! --Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: descriptor dilemma

2005-05-04 Thread Sébastien Boisgérault
Jeff Epler wrote: > > >>> id(c.f) == id(C.__dict__['f'].__get__(c,C)) > > True > > Here, c.f is discarded by the time the right-hand-side of == is > executed. So the object whose id() is being calculated on the > right-hand-side could turn out to be the same, since the two objects > have disjoint

Re: FTP/TLS connection using python

2005-05-04 Thread Larry Bates
I don't have direct experience by Google turned this up: http://trevp.net/tlslite/ Larry Bates scrimp wrote: > Hello, >I was wondering if there is any other way to securly connect to an > FTP site using SSL or TLS? I dont have the option of purchasing > M2Crypto from the site. Any help/sugg

Re: FTP/TLS connection using python

2005-05-04 Thread scrimp
Wow, thanks very much Ive been searching on google for a few days now and have never seen this yet. Thanks ill take a look at what I can do with this --Barry -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I sort a bunch of lists over multiple fields?

2005-05-04 Thread Steven Bethard
Lonnie Princehouse wrote: > Non-trivial: > Any time the user decides to (1) cache intermediary results for a cmp > function or (2) define a __cmp__ function for the key return value. > These arise when comparison of partial keys is often sufficient to > establish order between two objects. If yo

  1   2   >