Re: inspect.findsource problem with llinecache

2008-11-12 Thread Rafe
On Nov 12, 2:22 pm, Rafe <[EMAIL PROTECTED]> wrote: > Hi, > > I think I have discovered two bugs with the inspect module and I would > like to know if anyone can spot any traps in my workaround. > > I needed a function which takes a function or method and returns the > code inside it (it also adjus

Re: Are there any FOSS Python Single-Sign-on Servers?

2008-11-12 Thread Phillip B Oldham
On Nov 12, 1:12 am, Ben Finney <[EMAIL PROTECTED]> wrote: > Phillip B Oldham <[EMAIL PROTECTED]> writes: > OpenID is a means of *authentication*, it doesn't mandate any > particular system of registration or account creation. You presumably > already have solutions for those; use them, but de-coupl

Re: Python 2.5 and sqlite

2008-11-12 Thread Thorsten Kampe
* (Tue, 11 Nov 2008 17:58:15 -0500) > > > Can you ask them if sqlite3 is installed? and if not... to install > > > it? > > > > Why would he have to install SQLite?! > > Seems a stupid question. If he wants to use SQLite... it needs to be > on the system No. > ould include in your discussio

Re: sys.stdout, urllib and unicode... I don't understand.

2008-11-12 Thread Marc 'BlackJack' Rintsch
On Tue, 11 Nov 2008 12:18:26 -0800, Thierry wrote: > I have realized an wxPython simple application, that takes the input of > a user, send it to a web service, and get back translations in several > languages. > The service itself is fully UTF-8. > > The "source" string is first encoded to "lati

Re: Python 2.5 and sqlite

2008-11-12 Thread [EMAIL PROTECTED]
Thanks to everyone who replied. I should have been clearier with my initial post. Python (2.5.1) was compiled from source on the webserver that I use, without an associated sqlite present on the machine, so trying "import sqlite3" in a python application gives an error, but aside from that python i

How to navigate one window to another window through python scripts ?

2008-11-12 Thread sambasivareddy
Hi all, How to navigate one window to another window through python scripts ? Basically I want to do Automatic testing one windows base c#.net application through python scripts. I am Able to open the executable file with following scripts. Import os Os.system ('abc.exe') But ho

Re: Does Python mess with CRLFs?

2008-11-12 Thread John Machin
On Nov 12, 10:04 pm, Gilles Ganault <[EMAIL PROTECTED]> wrote: > Hello > > I'm stuck at understanding why Python can't extract some bit from an > HTML file using regexes, although I can find it just fine with > UltraEdit. > > I wonder if Python rewrites CRLFs when reading a text file with > open/re

Re: Python 2.5 and sqlite

2008-11-12 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Nov 12, 10:14 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: >> * [EMAIL PROTECTED] (Wed, 12 Nov 2008 01:27:01 -0800 (PST)) >> >>> Python (2.5.1) was compiled from source on the webserver that I use, >>> without an associated sqlite present on the machine, so trying "im

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Steve Holden
greg wrote: > Fredrik Lundh wrote: > >> It's not only misleading, it's also a seriously flawed reading of the >> original text - the Algol 60 report explicitly talks about assignment >> of *values*. > > Do you agree that an expression in Python has a value? > Most expressions have values. The on

credit kredite oesterreich ratenkredite online kredit ohne schufa in blitzkredite

2008-11-12 Thread [EMAIL PROTECTED]
credit kredite oesterreich ratenkredite online kredit ohne schufa in blitzkredite + + + + +++ GUENSTIGE KREDITE ONLINE +++ KREDITE IM INTERNET OHNE SCHUFA +++ + + http://www.usd.edu/phys/courses/astronomy/bord/messages/19924.html http://www.usd.edu/phys/courses/astronomy/bord/messages/19924.html h

Re: return a value to shell script

2008-11-12 Thread Tom Wright
devi thapa wrote: > I am executing a python script in a shell script. The python script > actually returns a value. > So, can I get the return value in a shell script? If yes, then help me > out. Yes. The variable $? should be bound to the return value of the last foreground program to exit. Th

Re: return a value to shell script

2008-11-12 Thread rishi pathak
Look at os._exit() On Wed, Nov 12, 2008 at 6:36 PM, devi thapa <[EMAIL PROTECTED]> wrote: > Hi, > > I am executing a python script in a shell script. The python script > actually returns a value. > So, can I get the return value in a shell script? If yes, then help me out. > > Regards, > Devi >

problem with JSON-RPC

2008-11-12 Thread Michel Perez
Hi everybody: I'm trying to use JSON-RPC to provide my services but produce this exception: Traceback (most recent call last): File "", line 1, in File "jsonrpc/proxy.py", line 43, in __call__ resp = loads(respdata) File "jsonrpc/json.py", line 211, in loads raise JSONDecodeExcepti

Re: problem with JSON-RPC

2008-11-12 Thread Diez B. Roggisch
Michel Perez wrote: > Hi everybody: > I'm trying to use JSON-RPC to provide my services but produce this > exception: > > Traceback (most recent call last): > File "", line 1, in > File "jsonrpc/proxy.py", line 43, in __call__ > resp = loads(respdata) > File "jsonrpc/json.py", line 21

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Charles V.
Hi, > Both may be standard compliant, but if you're depending on > implementation details, you may still get different behaviour. > I'm pretty sure that MySQLdb always fetches the entire resultset from > the server. The sqlite3 module uses what would have been called > "server-side cursors" in rea

Re: How can a function know what module it's in?

2008-11-12 Thread Joe Strout
On Nov 11, 2008, at 9:49 PM, Rafe wrote: I'm sure there is a magic identifier somewhere that lets a code get a reference to its own module, but I haven't been able to find it. import sys this_module = sys.modules[__name__] Beautiful! Thanks very much. For the archives, here is my standard

Re: duck-type-checking?

2008-11-12 Thread J Kenneth King
Joe Strout <[EMAIL PROTECTED]> writes: > Let me preface this by saying that I think I "get" the concept of > duck- > typing. > > However, I still want to sprinkle my code with assertions that, for > example, my parameters are what they're supposed to be -- too often I > mistakenly pass in somethi

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Gerhard Häring
Steve Holden wrote: [...] I feel with you. The fact that cursors, and not connection objects have the executeXXX methods is totally braindead. So you'd rather have to use separate connections? That would make isloated transaction processing a little tricky ... No, I just find code like: con

Re: [ANN] SQLkit 0.8.3.2

2008-11-12 Thread sandro
Thorsten Kampe wrote: >> >> I'm happy to announce release 0.8.3 of sqlkit package for python - the >> first public release. > > Are you aware that you announced "sqlite 0.8.3" in the subject??!! > Ops, I wasn't aware, just too tired... thanks for telling. Anyhow, since I had some problems i

ANN: eGenix mxODBC Connect - Python Database Interface 0.9.3 (beta)

2008-11-12 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com mxODBC Connect Python Database Interface Version 0.9.3 (beta) Our new client-server product for connecting Python applications

loading modules, metaclasses, chicken & eggs

2008-11-12 Thread sandro
Hi, I had two packages working fine toghether: debug and sqlkit. Debug provides a metaclass just for debuggging purposes to sqlkit (to log methods following a recipe on ASPN. It worked very well, just logging depending on the value of a module variable in debug module. That means module debug a

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Grant Edwards
On 2008-11-12, Steve Holden <[EMAIL PROTECTED]> wrote: > greg wrote: I stopped paying much attention to this thread a while ago, but you've got to admire the persistence of somebody who soldiers on even though Aahz, Fredrik Lund, and Steve Holden are all on the other side of the argument... -- G

Re: return a value to shell script

2008-11-12 Thread Jeff McNeil
On Nov 12, 8:19 am, "D'Arcy J.M. Cain" <[EMAIL PROTECTED]> wrote: > On Wed, 12 Nov 2008 13:09:21 + > > Tom Wright <[EMAIL PROTECTED]> wrote: > > devi thapa wrote: > > > I am executing a python script in a shell script. The python script > > > actually returns a value. > > > So, can I get the r

Re: return a value to shell script

2008-11-12 Thread Grant Edwards
On 2008-11-12, devi thapa <[EMAIL PROTECTED]> wrote: > I am executing a python script in a shell script. The python > script actually returns a value. So, can I get the return > value in a shell script? If yes, then help me out. There are two ways to "return" something to a shell script. 1) To

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Fredrik Lundh wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? Do you agree that it makes sense to talk about assigning that v

Re: help me~!!!'tuple' object has no attribute 'compile'

2008-11-12 Thread Peter Pearson
On Wed, 12 Nov 2008 02:07:46 -0800 (PST), [EMAIL PROTECTED] wrote: [snip] > > import urllib > import urllib2 > import re > import MySQLdb > > conn=MySQLdb.connect > (host="localhost",user="root",passwd="ylj",db="net", charset="utf8") > cur = conn.cursor() > sql='select > net_site.downline_re,net_si

Re: return a value to shell script

2008-11-12 Thread D'Arcy J.M. Cain
On Wed, 12 Nov 2008 13:09:21 + Tom Wright <[EMAIL PROTECTED]> wrote: > devi thapa wrote: > > I am executing a python script in a shell script. The python script > > actually returns a value. > > So, can I get the return value in a shell script? If yes, then help me > > out. > > Yes. The vari

Re: sys.stdout, urllib and unicode... I don't understand.

2008-11-12 Thread Thierry
Thank you to both of you (Marc and Tino). I feel a bit stupid right now, because as both of you said, encoding my source string to utf-8 do not produce an exception when I pass it to urllib.quote() and is what it should be. I was certain that this created an error sooner, and id not tried it again

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Steven D'Aprano wrote: Why should anyone take the "Revised Report on the Algorithmic Language Algol 60" as the "official" (only?) definition of call-by-value for all languages everywhere? Since the term was more or less invented by the people who designed Algol, I thought it would be a good i

Adding a proxy

2008-11-12 Thread William.Tse
Hello, How do I add a proxy to an http request in Python ? These are the first few lines of my code : import xml import fpconst import SOAPpy from SOAPpy import WSDL wsdlFile = 'http://..com/webService.wsdl' server = WSDL.Proxy(wsdlFile) I have the IP that I'm suppose to use, but I don't

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Fredrik Lundh
Aahz wrote: There you have it -- call by value is offially defined in terms of assignment. There is no mention in there of copying. So it's perfectly correct to use it in relation to Python. Except, of course, for the fact that it is generally misleading. It's not only misleading, it's also

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Steve Holden
Gerhard Häring wrote: > Charles V. wrote: >> Hi, >> >> Thank for replying. >> >>> Either use a second cursor OR ensure you fetch all the data from the >>> first .execute() first: >> >> Are these really the only solutions ? > > Yes. > >> I was expecting the same behavior than MySQLdb module, whic

Re: Python 2.5 and sqlite

2008-11-12 Thread [EMAIL PROTECTED]
On Nov 12, 10:14 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * [EMAIL PROTECTED] (Wed, 12 Nov 2008 01:27:01 -0800 (PST)) > > > Python (2.5.1) was compiled from source on the webserver that I use, > > without an associated sqlite present on the machine, so trying "import > > sqlite3" in a python

pygoocanvas binaries for windows?

2008-11-12 Thread sandro
Hi, I really need binaries for goocanva s for windows. There are plenty of places in innternet of people that tried to compile with no success. Have anybody of you managed to get them? thanks sandro -- http://mail.python.org/mailman/listinfo/python-list

Using the result of type() in a boolean statement?

2008-11-12 Thread dpapathanasiou
If I define a dictionary where one or more of the values is also a dictionary, e.g.: my_dict={"a":"string", "b":"string", "c":{"x":"0","y":"1"}, "d":"string"} How can I use the output of type() so I can do one thing if the value is a string, and another if the value is a dictionary? i.e., I'd li

fputs in tp_print crashes under Win32

2008-11-12 Thread Petr Gotthard
Hello, my C++ extension crashes under Win32 when the tp_print is called. It crashes with both Python 2.5.2 and 2.6. The crash occurs in system32\ntdll.dll, with exception code 0xc005. I found out that this works fine: int ulonghandle_print(RtiULongHandleObject *v, FILE *fp, int flags) {

Re: How to navigate one window to another window through python scripts ?

2008-11-12 Thread Godson Gera
On Wed, Nov 12, 2008 at 3:01 PM, sambasivareddy <[EMAIL PROTECTED]>wrote: > Hi all, > > > > How to navigate one window to another window through python scripts ? > > > > Basically I want to do Automatic testing one windows base c#.net > application through python scripts. > > > > I am Able to op

help me~!!!'tuple' object has no attribute 'compile'

2008-11-12 Thread ylj798
my code --- # -*- coding: utf8 -*- #!/usr/bin/python import urllib import urllib2 import re import MySQLdb conn=MySQLdb.connect (host="localhost",user="root",passwd="ylj",db="net", charset="utf8") cur = conn.c

Re: How can a function know what module it's in?

2008-11-12 Thread Steve Holden
Joe Strout wrote: > Some corrections, to highlight the depth of my confusion... > > On Nov 11, 2008, at 9:10 PM, Joe Strout wrote: > >> doctest.testmod(mymodule) >> >> This actually works fine if I'm importing the module (with the >> standard name) somewhere else > > Actually, it does not. >

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Charles V.
Hi, Thank for replying. > Either use a second cursor OR ensure you fetch all the data from the > first .execute() first: Are these really the only solutions ? I was expecting the same behavior than MySQLdb module, which is, as sqlite3, DB-API 2.0 compatible. It means a program written for MySQ

Re: return a value to shell script

2008-11-12 Thread Marco Bizzarri
On Wed, Nov 12, 2008 at 2:06 PM, devi thapa <[EMAIL PROTECTED]> wrote: > Hi, > > I am executing a python script in a shell script. The python script > actually returns a value. > So, can I get the return value in a shell script? If yes, then help me out. > > Regards, > Devi > -- > http://mail.pyth

Re: duck-type-checking?

2008-11-12 Thread Matimus
On Nov 12, 7:06 am, Joe Strout <[EMAIL PROTECTED]> wrote: > Let me preface this by saying that I think I "get" the concept of duck- > typing. > > However, I still want to sprinkle my code with assertions that, for   > example, my parameters are what they're supposed to be -- too often I   > mistake

Re: duck-type-checking?

2008-11-12 Thread Cristina Yenyxe González García
2008/11/12 Joe Strout <[EMAIL PROTECTED]>: > > So I need functions to assert that a given identifier quacks like a string, > or a number, or a sequence, or a mutable sequence, or a certain class, or so > on. (On the class check: I know about isinstance, but that's contrary to > duck-typing -- what

Upcoming Conference

2008-11-12 Thread Harry
Upcoming conference please visit http://zeus.cp.eng.chula.ac.th/~g49snk -- http://mail.python.org/mailman/listinfo/python-list

Re: duck-type-checking?

2008-11-12 Thread Tim Rowe
2008/11/12 Joe Strout <[EMAIL PROTECTED]>: > Let me preface this by saying that I think I "get" the concept of > duck-typing. > > However, I still want to sprinkle my code with assertions that, for example, > my parameters are what they're supposed to be -- too often I mistakenly pass > in somethin

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread greg
Steven D'Aprano wrote: If you insist that Python is call by value, the only way that can work is by defining values to be references, which is nothing like Algol. No, that's not the only way. You can also make it work by accepting the original definition of call-by-value at face value -- i.e.

Re: help me~!!!'tuple' object has no attribute 'compile'

2008-11-12 Thread John Machin
On Nov 12, 9:07 pm, [EMAIL PROTECTED] wrote: > my code > --- > # -*- coding: utf8 -*- > #!/usr/bin/python > > import urllib > import urllib2 > import re > import MySQLdb > > conn=MySQLdb.connect > (host="localho

Re: Python 2.5 and sqlite

2008-11-12 Thread Thorsten Kampe
* [EMAIL PROTECTED] (Wed, 12 Nov 2008 01:27:01 -0800 (PST)) > Python (2.5.1) was compiled from source on the webserver that I use, > without an associated sqlite present on the machine, so trying "import > sqlite3" in a python application gives an error, but aside from that > python is mostly behav

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Francesco Guerrieri
On Wed, Nov 12, 2008 at 2:01 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Now, can we get on to something substantive like how many angels can > dance on the head of a pin? > Oh, come on, that's too easy! 42. I thought that by now everybody knew that. Francesco -- http://mail.python.org/mailman/

Re: sys.stdout, urllib and unicode... I don't understand.

2008-11-12 Thread Thierry
> Are you sure that Python wasn't just printing out "\n" because you'd > asked it to show you the repr() of a string containing newlines? Yes, I am sure. Because I dumped the ord() values to check them. But again, I'm stumped on how complicated I have made this. I should not try to code anymore at

Re: sys.stdout, urllib and unicode... I don't understand.

2008-11-12 Thread Steve Holden
Thierry wrote: > Thank you to both of you (Marc and Tino). > > I feel a bit stupid right now, because as both of you said, encoding > my source string to utf-8 do not produce an exception when I pass it > to urllib.quote() and is what it should be. > I was certain that this created an error sooner

Re: int() and leading zeros in Python 2.6

2008-11-12 Thread Pete Forman
Peter Otten <[EMAIL PROTECTED]> writes: > you're wrong. Indeed I am, sorry for the waste of time. -- Pete Forman-./\.- Disclaimer: This post is originated WesternGeco -./\.- by myself and does not represent [EMAIL PROTECTED]-./\.- the opinion of Schlumb

Re: Does Python mess with CRLFs?

2008-11-12 Thread Gilles Ganault
On Wed, 12 Nov 2008 12:04:07 +0100, Gilles Ganault <[EMAIL PROTECTED]> wrote: >I wonder if Python rewrites CRLFs when reading a text file with >open/read? For those seeing the same thing, the answer is yes: On Windows, the code above turns CRLF into LF. I tried "rb" instead of "r", with no differe

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Steve Holden
Charles V. wrote: > Hi, > > Thank for replying. > >> Either use a second cursor OR ensure you fetch all the data from the >> first .execute() first: > > Are these really the only solutions ? I was expecting the same behavior than > MySQLdb module, which is, as sqlite3, DB-API 2.0 compatible. >

Re: How can a function know what module it's in?

2008-11-12 Thread Arnaud Delobelle
Joe Strout <[EMAIL PROTECTED]> writes: > I've been using docstring to exercise each of my modules, with code > like this: > > def _test(): > import doctest > doctest.testmod() > > if __name__ == "__main__": > _test() > > > This works great when I execute each module by itself. H

Re: duck-type-checking?

2008-11-12 Thread Terry Reedy
Joe Strout wrote: Let me preface this by saying that I think I "get" the concept of duck-typing. However, I still want to sprinkle my code with assertions that, for example, my parameters are what they're supposed to be -- too often I mistakenly pass in something I didn't intend, and when tha

Re: duck-type-checking?

2008-11-12 Thread Terry Reedy
Cristina Yenyxe González García wrote: 2008/11/12 Joe Strout <[EMAIL PROTECTED]>: So I need functions to assert that a given identifier quacks like a string, or a number, or a sequence, or a mutable sequence, or a certain class, or so on. (On the class check: I know about isinstance, but that's

Re: Does Python mess with CRLFs?

2008-11-12 Thread Irmen de Jong
Gilles Ganault wrote: On Wed, 12 Nov 2008 12:04:07 +0100, Gilles Ganault <[EMAIL PROTECTED]> wrote: I wonder if Python rewrites CRLFs when reading a text file with open/read? For those seeing the same thing, the answer is yes: On Windows, the code above turns CRLF into LF. I tried "rb" instea

Re: Using the result of type() in a boolean statement?

2008-11-12 Thread Terry Reedy
dpapathanasiou wrote: If I define a dictionary where one or more of the values is also a dictionary, e.g.: my_dict={"a":"string", "b":"string", "c":{"x":"0","y":"1"}, "d":"string"} How can I use the output of type() so I can do one thing if the value is a string, and another if the value is a d

Re: Does Python mess with CRLFs?

2008-11-12 Thread Irmen de Jong
Gilles Ganault wrote: Hello I'm stuck at understanding why Python can't extract some bit from an HTML file using regexes, although I can find it just fine with UltraEdit. #BAD friends = re.compile('\r\n\r\n',re.IGNORECASE | re.MULTILINE | re.DOTALL) If you keep running into trouble and

Re: My first Python program -- a lexer

2008-11-12 Thread Thomas Mlynarczyk
Steve Holden schrieb: Suppose I use the dict and I want to access the regex associatetd with the token named "tokenname" (that is, no iteration, but a single access). I could simple write tokendict["tokenname"]. But with the list of tuples, I can't think of an equally easy way to do that. But th

Re: pygoocanvas binaries for windows?

2008-11-12 Thread Mike Driscoll
On Nov 12, 11:16 am, sandro <[EMAIL PROTECTED]> wrote: > Hi, > >   I really need binaries for goocanva s for windows. >   There are plenty of places in innternet of people that tried to >   compile with no success. Have anybody of you managed to get them? > > thanks > sandro Are you talking about

Re: duck-type-checking?

2008-11-12 Thread Joe Strout
On Nov 12, 2008, at 10:45 AM, Tim Rowe wrote: What do you actually mean by "Quacks like a string"? Supports the 'count()' method? Then you find out if it doesn't when you try to apply the 'count()' method. Supports some method that you don't actually use? Then why do you care? Because if I wri

Re: duck-type-checking?

2008-11-12 Thread George Sakkis
On Nov 12, 1:35 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Cristina Yenyxe González García wrote: > > > 2008/11/12 Joe Strout <[EMAIL PROTECTED]>: > >> So I need functions to assert that a given identifier quacks like a string, > >> or a number, or a sequence, or a mutable sequence, or a certain

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Gerhard Häring
Charles V. wrote: Hi, Thank for replying. Either use a second cursor OR ensure you fetch all the data from the first .execute() first: Are these really the only solutions ? Yes. I was expecting the same behavior than MySQLdb module, which is, as sqlite3, DB-API 2.0 compatible. Both ma

Re: best python unit testing framwork

2008-11-12 Thread Timothy Grant
On Tue, Nov 11, 2008 at 2:59 PM, Brendan Miller <[EMAIL PROTECTED]> wrote: > What would heavy python unit testers say is the best framework? > > I've seen a few mentions that maybe the built in unittest framework > isn't that great. I've heard a couple of good things about py.test and > nose. Are t

Re: [Array] Finding index that contains part of a string?

2008-11-12 Thread Tim Chase
Out of curiosity, is there a better way in Python to iterate through an array, and return the index of each item that contains the bit somewhere in its value, ie. index() doesn't work because it only returns if the value only contains the item I'm looking for. This works: next = re.compi

Re: duck-type-checking?

2008-11-12 Thread Joe Strout
On Nov 12, 2008, at 11:48 AM, [EMAIL PROTECTED] wrote: It seems to me that what you are describing is exactly what abcs were added for in 2.6, in particular registration: class AnotherClass(metaclass=ABCMeta): pass AnotherClass.register(basestring) assert isinstance(str, AnotherClass) Plea

Re: loading modules, metaclasses, chicken & eggs

2008-11-12 Thread Aaron Brady
On Nov 12, 9:38 am, sandro <[EMAIL PROTECTED]> wrote: > Hi, > Is there a way to solve this? I'd like ro force a reload of the > metaclass after 'debug'  has been loaded and debug.DBG set to True, > but that doesn't seem to happen... > > Any hints? > > sandro > *:-) > > sqlkit:  http://sqlkit.argoli

Re: pysqlite install error on hp ux (ld: Can't find library for -lpython2.5)

2008-11-12 Thread Gerhard Häring
Geon. wrote: hi everyone! when i install pysqlite i meet bellow error. ( use easy_install and source code building same problem ) ld: Can't find library for -lpython2.5 what mean this message? and what i do? my system is hp-ux 11i v3. and python2.5 is installed. ld command also avaliable. I

Re: loading modules, metaclasses, chicken & eggs

2008-11-12 Thread sandro
Aaron Brady wrote: > On Nov 12, 9:38 am, sandro <[EMAIL PROTECTED] wrote: >> Hi, >> Is there a way to solve this? I'd like ro force a reload of the >> metaclass after 'debug'  has been loaded and debug.DBG set to True, >> but that doesn't seem to happen... >> >> Any hints? >> >> sandro >> *:-) >>

Re: Installing Python 2.6 on Vista

2008-11-12 Thread Scott David Daniels
Martin v. Löwis wrote: It installs fine for 'just me', so no problem. It installs for 'just me', but it doesn't work. Just try starting IDLE, or import the socket module. Regards, Martin See bug 3296 (and its patch). If the import produces a warning, Idle's improper use of the format_warning

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Fredrik Lundh
greg wrote: It's not only misleading, it's also a seriously flawed reading of the original text - the Algol 60 report explicitly talks about assignment of *values*. Do you agree that an expression in Python has a value? > Do you agree that it makes sense to talk about assigning that value t

Re: Null object pattern

2008-11-12 Thread Robin Becker
Ben Finney wrote: Terry Reedy <[EMAIL PROTECTED]> writes: We're not going to add the "feature" back that None compares smaller than everything. It's a slippery slope that ends with all operations involving None returning None -- I've seen a proposal made in all earnestness requesting that None+

Re: duck-type-checking?

2008-11-12 Thread Tim Rowe
2008/11/12 Joe Strout <[EMAIL PROTECTED]>: >> If you need to know that it walks like a duck, mates like a duck and >> tastes like a duck when roasted, you probably want it to really /be/ a >> duck and should go back to inheritance. > > I can't agree; there are times when inheritance just won't do,

Re: [Python-Dev] Python 2.5.3: call for patches

2008-11-12 Thread Martin v. Löwis
>> In principle, this is fine with me, so go ahead. > > Done. Thanks for looking into these! Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Official definition of call-by-value (Re: Finding the instance reference...)

2008-11-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Grant Edwards <[EMAIL PROTECTED]> wrote: >On 2008-11-12, Steve Holden <[EMAIL PROTECTED]> wrote: >> greg wrote: > >I stopped paying much attention to this thread a while ago, but >you've got to admire the persistence of somebody who soldiers >on even though Aahz, Fr

Re: Simple question about Python lists

2008-11-12 Thread Scott David Daniels
Eric wrote: ... In MATLAB, if I just want the first, fifth and eighth element I might do something like this: b = a([1 5 8]); On Nov 11, 1:51 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> replied: b = [a[i] for i in [1, 5, 8]] To which Eric said: Thanks! It makes sense, but in this cas

Re: Are there any FOSS Python Single-Sign-on Servers?

2008-11-12 Thread Ben Finney
Phillip B Oldham <[EMAIL PROTECTED]> writes: > So... are there any good OpenID/OAuth servers written in python? Rather than continue the discussion in this thread, I'll point you to the starting point for further information at the OpenID site http://openid.net/developers/>. Good hunting! --

Single-instance daemons

2008-11-12 Thread Jeffrey Barish
As per Stevens/Rago, "file and record locking provides a convenient mutual-exclusion mechanism". They note the convention of putting the lock file in /var/run in a file called .pid, where is the name of the daemon and content is the pid. Seems like a good suggestion as I see pid files from many

return a value to shell script

2008-11-12 Thread devi thapa
Hi, I am executing a python script in a shell script. The python script actually returns a value. So, can I get the return value in a shell script? If yes, then help me out. Regards, Devi -- http://mail.python.org/mailman/listinfo/python-list

duck-type-checking?

2008-11-12 Thread Joe Strout
Let me preface this by saying that I think I "get" the concept of duck- typing. However, I still want to sprinkle my code with assertions that, for example, my parameters are what they're supposed to be -- too often I mistakenly pass in something I didn't intend, and when that happens, I w

Does Python mess with CRLFs?

2008-11-12 Thread Gilles Ganault
Hello I'm stuck at understanding why Python can't extract some bit from an HTML file using regexes, although I can find it just fine with UltraEdit. I wonder if Python rewrites CRLFs when reading a text file with open/read? Here's the code: == f = open("content.html", "r") content = f.r

Re: Problem with sqlite3 cursor and imbricated for loop

2008-11-12 Thread Gerhard Häring
Charles V. wrote: Hi, Both may be standard compliant, but if you're depending on implementation details, you may still get different behaviour. I'm pretty sure that MySQLdb always fetches the entire resultset from the server. The sqlite3 module uses what would have been called "server-side curs

Re: int() and leading zeros in Python 2.6

2008-11-12 Thread Peter Otten
Pete Forman wrote: > I'm holding off installing Python 2.6, waiting for some packages to > become available for it. I wonder if someone could tell me the best > way to avoid future problems parsing decimal integers with leading > zeros. You can have multiple versions of python simultaneously.

[Array] Finding index that contains part of a string?

2008-11-12 Thread Gilles Ganault
Hello Out of curiosity, is there a better way in Python to iterate through an array, and return the index of each item that contains the bit somewhere in its value, ie. index() doesn't work because it only returns if the value only contains the item I'm looking for. This works: next = re

Re: Single-instance daemons

2008-11-12 Thread Jeff McNeil
On Nov 12, 4:57 pm, Jeffrey Barish <[EMAIL PROTECTED]> wrote: > As per Stevens/Rago, "file and record locking provides a convenient > mutual-exclusion mechanism". They note the convention of putting the lock > file in /var/run in a file called .pid, where is the name of > the daemon and content i

Re: loading modules, metaclasses, chicken & eggs

2008-11-12 Thread Aaron Brady
On Nov 12, 3:01 pm, sandro <[EMAIL PROTECTED]> wrote: > Aaron Brady wrote: > > On Nov 12, 9:38 am, sandro <[EMAIL PROTECTED] wrote: > >> Hi, > >> Is there a way to solve this? I'd like ro force a reload of the > >> metaclass after 'debug'  has been loaded and debug.DBG set to True, > >> but that do

int() and leading zeros in Python 2.6

2008-11-12 Thread Pete Forman
I'm holding off installing Python 2.6, waiting for some packages to become available for it. I wonder if someone could tell me the best way to avoid future problems parsing decimal integers with leading zeros. >>> int('09') 9 That works in 2.5 but will break in 2.6 AFAIK as int() is being change

Re: duck-type-checking?

2008-11-12 Thread Joe Strout
On Nov 12, 2008, at 2:42 PM, Tim Rowe wrote: And then the original class definition changes -- new members added -- but the ones from the factory class don't change, and so are no longer compliant with the the factory class (which doesn't support the new "form_pun_relating_to_avoiding_a_high_haz

Re: duck-type-checking?

2008-11-12 Thread pruebauno
On Nov 12, 1:22 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Nov 12, 2008, at 10:45 AM, Tim Rowe wrote: > > > What do you actually mean by "Quacks like a string"? Supports the > > 'count()' method? Then you find out if it doesn't when you try to > > apply the 'count()' method. Supports some metho

Re: Single-instance daemons

2008-11-12 Thread Cameron Simpson
On 12Nov2008 14:07, Jeff McNeil <[EMAIL PROTECTED]> wrote: | On Nov 12, 4:57 pm, Jeffrey Barish <[EMAIL PROTECTED]> wrote: | > As per Stevens/Rago, "file and record locking provides a convenient | > mutual-exclusion mechanism". They note the convention of putting the lock | > file in /var/run in a

Re: Python 2.5 and sqlite

2008-11-12 Thread david . lyon
Thorsten, Quoting Thorsten Kampe <[EMAIL PROTECTED]>: * (Tue, 11 Nov 2008 17:58:15 -0500) > > Can you ask them if sqlite3 is installed? and if not... to install > > it? > > Why would he have to install SQLite?! Seems a stupid question. If he wants to use SQLite... it needs to be on the syst

Re: Using the result of type() in a boolean statement?

2008-11-12 Thread Scott David Daniels
dpapathanasiou wrote: ... I'd like to define a loop like this, ... for key, value in my_dict.items(): if type{value) is : # do the dictionary logic elif type(value) is : # do the string logic # etc You're searching for "isinstance" (or possibly issubclass) for key, value in my_d

Re: best python unit testing framwork

2008-11-12 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Timothy Grant" <[EMAIL PROTECTED]> wrote: > I wanted to like unittest but couldn't. So I started using py.test. I > even wrote a plugin for TextMate to interface with py.test. If I had > known about Nose I would likely have used it instead because it is > built on

Re: duck-type-checking?

2008-11-12 Thread Terry Reedy
Joe Strout wrote: On Nov 12, 2008, at 2:42 PM, Tim Rowe wrote: True. I love the ABC approach; now I just have to figure out whether I love it enough to move our entire company over to 2.6 (despite 2.5's great advantage that it's pre-installed on every Mac by default), or whether instead I'l

PIL's ImageFile Parser and PNG's

2008-11-12 Thread Silfheed
Heyas So I've been messing around with the PIL and PNG's and came across a little problem with PNG's. So just to clarify, I'm running with the standard ubuntu 8.04 python- imaging package that installs zlib and all the other goodies that go along to make the PIL work with PNG's nicely. So this w

Re: best python unit testing framwork

2008-11-12 Thread Timothy Grant
On Wed, Nov 12, 2008 at 5:16 PM, Roy Smith <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > "Timothy Grant" <[EMAIL PROTECTED]> wrote: > >> I wanted to like unittest but couldn't. So I started using py.test. I >> even wrote a plugin for TextMate to interface with py.test. If I had >>

email questions

2008-11-12 Thread ted & irma slage
I tried to get a message to the below email address and this information was sent back to me. Can you help me find out why it would not go through, or send it to the place that may help me? Thank you, Irma Slage [EMAIL PROTECTED] The error that the other server returned was: 553 553 5.3.0 <[

need to suspend/resume a child thread

2008-11-12 Thread scsoce
A child thread has a long-time executions, how to suspend it and resume back the orignial place ? I know it' nature to use singal, but child thread cannot get signal as Python Manual say. And i dnt like to check status variable as the long-time executions can not or be dirty to stop to do c

  1   2   >