How do I set a callback in Python?

2008-09-08 Thread catsclaw
I can't for the life of me figure out how to set a callback in Python. I have a class, which wraps another class. The second class needs a callback assigned. I don't want to use globals for it. Here's what I'd like to do: class MyWrapper: def get_login(self, username): return self.u

Re: How do I set a callback in Python?

2008-09-08 Thread Rob Williscroft
catsclaw wrote in news:d797403a-e492-403f-933a-bd18ef53d5c0 @k13g2000hse.googlegroups.com in comp.lang.python: > I can't for the life of me figure out how to set a callback in > Python. I have a class, which wraps another class. The second class > needs a callback assigned. I don't want to use

Re: How do I set a callback in Python?

2008-09-08 Thread Diez B. Roggisch
catsclaw schrieb: I can't for the life of me figure out how to set a callback in Python. I have a class, which wraps another class. The second class needs a callback assigned. I don't want to use globals for it. Here's what I'd like to do: class MyWrapper: def get_login(self, username):

Re: How do I set a callback in Python?

2008-09-08 Thread Gary Herron
catsclaw wrote: I can't for the life of me figure out how to set a callback in Python. I have a class, which wraps another class. The second class needs a callback assigned. I don't want to use globals for it. Here's what I'd like to do: class MyWrapper: def get_login(self, username):

Re: Spotlight Searching in Python - Mac OSX

2008-09-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Hi all, I'm having some issues getting a spotlight search to work similar to the program demonstrated here: http://pyobjc.sourceforge.net/examples/pyobjc-framework-Cocoa/AppKit/PredicateEditorSample/ Here is my class, complete with the code I am trying to use it with

Hey guys!

2008-09-08 Thread [EMAIL PROTECTED]
hey guys! I have this site www.drachensee.info and i keep posting on the ubuntu, the latest open soruce buzz.. i post on stuff like editing the grub menu and other linux related stuff.. so drop in and drop ur comments ;-] -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] pysqlite 2.5.0 released

2008-09-08 Thread Gerhard Häring
Matthias Huening wrote: Hi, - - Connection.enable_load_extension(enabled) to allow/disallow extension loading. Allows you to use fulltext search extension, for example ;-) The following code (from the docs) produces an error: from pysqlite2 import dbapi2 as sqlite3 con = sqlite3.connect(":

String to hexadecimal conversion

2008-09-08 Thread Praveena P
Hi folks, I am new to Python... so am not too sure about how the type conversion works. I have to read a file that contains hexadecimal data and use the data further to do some arithmetic calculations. A sample of the input is : 20E032F8400022005E The problem I am facing i

Re: Updating python dictionary

2008-09-08 Thread John Machin
On Sep 8, 10:47 am, MK Bernard <[EMAIL PROTECTED]> wrote: > On Sep 7, 3:37 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > > > On Sep 8, 7:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Hello... > > > > I have a dict of key/values and I want to change the keys in it, based > > >

Re: universal unicode font for reportlab

2008-09-08 Thread Ben Finney
Laszlo Nagy <[EMAIL PROTECTED]> writes: > I could not find any free TTF font that can do latin1, latin2, > arabic, chinese and other languages at the same time. Is there a > single font that is able to handle these languages? The GNU Unifont http://en.wikipedia.org/wiki/GNU_Unifont> http://unifou

Syntax Problem with strptime in Python 2.4

2008-09-08 Thread W. eWatson
Apparently, use of strptime of datetime needs a workaround in Python 2.4 to work properly. The workaround is d = datetime.datetime(*(time.strptime(date_string, format)[0:5])). However, when I try to use it, or even use it the regular way, it fails with AttributeError: type object 'datetime.date

Re: [ANN] pysqlite 2.5.0 released

2008-09-08 Thread Matthias Huening
Gerhard Häring (08.09.2008 10:12): Error is: con.execute("select load_extension('./fts3.so')") pysqlite2._sqlite.OperationalError: Das angegebene Modul wurde nicht gefunden. Where should I look for the module? The sources are in ext/fts3 in the SQLite source tree. I haven't found any Mak

Re: Updating python dictionary

2008-09-08 Thread John Machin
On Sep 8, 9:14 am, "James Mills" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 8, 2008 at 8:59 AM, John Machin <[EMAIL PROTECTED]> wrote: > > What do you mean by "this right"? Perhaps the Divine Right of OPs, > > managers, examiners, business analysts, etc never to give a complete > > spec up front and

Re: Error importing mxTidy

2008-09-08 Thread M.-A. Lemburg
On 2008-09-07 15:00, Mike Hostetler wrote: > I built and installed mx-experimental 3.0.0 from source and it seemed to go > fine. But when I try to import it, I get this: > > localhost% python -c "import mx.Tidy" > Traceback (most recent call last): > File "", line 1, in ? > File "mx/T

Unable to start a process with subprocess Popen()

2008-09-08 Thread dudeja . rajat
Hi, I'm using the subprocess module's Popen() to start a batch file. This batch file basically calls an exe which also gets started. Unfortunately, this does not produce any results. I looked into the Task bar that this exe has started but it does not consume and cpu so I believet that this exe is

Re: Syntax Problem with strptime in Python 2.4

2008-09-08 Thread skip
>> Apparently, use of strptime of datetime needs a workaround in Python >> 2.4 to work properly. The workaround is d = >> datetime.datetime(*(time.strptime(date_string, >> format)[0:5])). However, when I try to use it, or even use it the >> regular way, it fails with AttributeE

Re: String to hexadecimal conversion

2008-09-08 Thread Praveena P
On Sep 8, 2:31 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 8, 7:05 pm, Praveena P <[EMAIL PROTECTED]> wrote: > > > Hi folks, > > > I am new to Python... so am not too sure about how the type conversion > > works. > > > I have to read a file that contains hexadecimal data and use the data >

how to use execfile with input parameters

2008-09-08 Thread Shi, Shaozhong
I have a Python script expecting 11 or 12 input parameters. How do I use execfile to execute the Python script in my new Python script? How do I pass in the input parameters? Yours sincerely, David This email has been scanned for all viruses by the MessageLabs Email Security System.-- h

Re: Unable to start a process with subprocess Popen()

2008-09-08 Thread dudeja . rajat
On Mon, Sep 8, 2008 at 11:50 AM, <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using the subprocess module's Popen() to start a batch file. This > batch file basically calls an exe which also gets started. > Unfortunately, this does not produce any results. I looked into the > Task bar that this exe ha

Re: [ANN] pysqlite 2.5.0 released

2008-09-08 Thread Gerhard Häring
Matthias Huening wrote: Gerhard Häring (08.09.2008 10:12): Error is: con.execute("select load_extension('./fts3.so')") pysqlite2._sqlite.OperationalError: Das angegebene Modul wurde nicht gefunden. Where should I look for the module? The sources are in ext/fts3 in the SQLite source tree.

Where does the command "ls" in some doctest files come from ?

2008-09-08 Thread KLEIN Stéphane
Hi, for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ tests.py?rev=89831&view=auto test file, there is this doctests : def develop_verbose(): """ We should be able to deal with setup scripts that aren't setuptools based. >>> mkdir('foo') >>> write('foo', 'setup.p

Re: tracking collection modification

2008-09-08 Thread usenet . tolomea
On Sep 7, 8:54 pm, [EMAIL PROTECTED] wrote: > I'm working on a remote object system, something kinda like Pyro. > For the purposes of caching I need to be able to tell if a given > dict / list / set has been modified. > Ideally what I'd like is for them to have a modification count > variable that

Re: Test if list contains another list

2008-09-08 Thread James Mills
Hi, >>> a = [1,2,3] >>> b = [3,2,1,4] >>> a = set(a) >>> b = set(b) >>> a.intersection(b) set([1, 2, 3]) Is this what you want ? cheers James On 9/8/08, mathieu <[EMAIL PROTECTED]> wrote: > Hi there, > > I am trying to write something very simple to test if a list > contains another one: > >

Re: universal unicode font for reportlab

2008-09-08 Thread Laszlo Nagy
Laszlo Nagy <[EMAIL PROTECTED]> writes: I could not find any free TTF font that can do latin1, latin2, arabic, chinese and other languages at the same time. Is there a single font that is able to handle these languages? The GNU Unifont http://en.wikipedia.org/wiki/GNU_Unifont> http:/

Re: tracking collection modification

2008-09-08 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > On Sep 7, 8:54 pm, [EMAIL PROTECTED] wrote: >> I'm working on a remote object system, something kinda like Pyro. >> For the purposes of caching I need to be able to tell if a given >> dict / list / set has been modified. >> Ideally what I'd like is for them to have a mod

Re: Read and write binary data

2008-09-08 Thread Mars creature
On Sep 7, 8:55 pm, Patrick Maupin <[EMAIL PROTECTED]> wrote: > On Sep 7, 5:41 pm, Mars creature <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > I am new to Python, and thinking about migrating to it from matlab > > as it is a really cool language. Right now, I am trying to figure out > > how to con

Re: Syntax Problem with strptime in Python 2.4

2008-09-08 Thread Diez B. Roggisch
W. eWatson wrote: > Apparently, use of strptime of datetime needs a workaround in Python 2.4 > to work properly. The workaround is d = > datetime.datetime(*(time.strptime(date_string, format)[0:5])). However, > when I try to use it, or even use it the regular way, it fails with > AttributeError: t

universal unicode font for reportlab

2008-09-08 Thread Laszlo Nagy
I need to create multi lingual invoices from reportlab. I think it is possible to use UTF 8 strings but there is a problem with the font. I could not find any free TTF font that can do latin1, latin2, arabic, chinese and other languages at the same time. Is there a single font that is able to h

Re: Where does the command "ls" in some doctest files come from ?

2008-09-08 Thread Steven D'Aprano
On Mon, 08 Sep 2008 12:15:15 +, KLEIN Stéphane wrote: > Hi, > > for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ > tests.py?rev=89831&view=auto test file, there is this doctests : [snip] > >>> ls('develop-eggs') > I wonder where does the "ls('develop-eggs')" comm

Dictionaries and loops

2008-09-08 Thread Mike P
Hi All i have a CSV file that i'm reading in and each line has the look of the below {None: ['User-ID', 'Count']} {None: ['576460847178667334', '1']} {None: ['576460847178632334', '8']} i want to make a dictionary of items in the form {576460847178667334:1, 576460847178632334:8, . } for all r

Re: Test if list contains another list

2008-09-08 Thread Bruno Desthuilliers
mathieu a écrit : Hi there, I am trying to write something very simple to test if a list contains another one: a = [1,2,3] b = [3,2,1,4] but 'a in b' returns False. Indeed. Lists are not sets, and the fact that all elements of list a happens to also be part of list b doesn't make the lis

Re: Test if list contains another list

2008-09-08 Thread Christian Heimes
mathieu wrote: Hi there, I am trying to write something very simple to test if a list contains another one: a = [1,2,3] b = [3,2,1,4] but 'a in b' returns False. How do I check that a is indeed contained in b ? Use sets: >>> a = [1,2,3] >>> b = [3,2,1,4] >>> set(a).issubset(set(b)) True

Re: Test if list contains another list

2008-09-08 Thread mathieu
On Sep 8, 9:32 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > mathieu a écrit : > > > Hi there, > > > I am trying to write something very simple to test if a list > > contains another one: > > > a = [1,2,3] > > > b = [3,2,1,4] > > > but 'a in b' returns False. > > Indeed. Lists are not sets

Re: String to hexadecimal conversion

2008-09-08 Thread Praveena P
On Sep 8, 2:05 pm, Praveena P <[EMAIL PROTECTED]> wrote: > Hi folks, > > I am new to Python... so am not too sure about how the type conversion > works. > > I have to read a file that contains hexadecimal data and use the data > further to do some arithmetic calculations. > A sample of the input is

Test if list contains another list

2008-09-08 Thread mathieu
Hi there, I am trying to write something very simple to test if a list contains another one: a = [1,2,3] b = [3,2,1,4] but 'a in b' returns False. How do I check that a is indeed contained in b ? thanks -- http://mail.python.org/mailman/listinfo/python-list

Clearing a session and reload() problem (with repro error)

2008-09-08 Thread Rafe
Hi, This seems to be an old question, and I've read back a bit, but rather than assume the answer is "you can't do that", I'd thought I'd post my version of the question along with a reproducible error to illustrate my confusion. My problem is that I'm using Python inside XSI (a 3D graphics appli

Re: String to hexadecimal conversion

2008-09-08 Thread John Machin
On Sep 8, 7:05 pm, Praveena P <[EMAIL PROTECTED]> wrote: > Hi folks, > > I am new to Python... so am not too sure about how the type conversion > works. > > I have to read a file that contains hexadecimal data and use the data > further to do some arithmetic calculations. > A sample of the input is

Re: universal unicode font for reportlab

2008-09-08 Thread Laszlo Nagy
The GNU Unifont http://en.wikipedia.org/wiki/GNU_Unifont> http://unifoundry.com/unifont.html> covers an impressive range of the Unicode Basic Multilingual Plane. Unifont is originally a bitmap font, but was recently made available in TrueType format http://www.lgm.cl/trabajos/unifont/index.en

flock trouble

2008-09-08 Thread Seb
I'm trying to implement a file server using the code below. However the locking doesn't work. I can delete while put'ing a file. Anyone got an idea about why? best regards, seb #! /usr/bin/env python import Pyro.core, Pyro.naming from Pyro.errors import PyroError, NamingError import sys impo

Re: Learning Python

2008-09-08 Thread Alan G Isaac
On 9/6/2008 5:17 AM James Pilling apparently wrote: Hi im currently starting to learn python in sixth form at school any tips? The books suggestions of others are quite good. Here is another approach: pick an easily understandable application, and work doing things with it. Perhaps immodestly,

Re: tracking collection modification

2008-09-08 Thread Paul Boddie
On 7 Sep, 12:54, [EMAIL PROTECTED] wrote: > I'm working on a remote object system, something kinda like Pyro. > For the purposes of caching I need to be able to tell if a given > dict / list / set has been modified. > Ideally what I'd like is for them to have a modification count > variable that in

Re: Dictionaries and loops

2008-09-08 Thread Bruno Desthuilliers
Mike P a écrit : Hi All i have a CSV file that i'm reading in and each line has the look of the below {None: ['User-ID', 'Count']} {None: ['576460847178667334', '1']} {None: ['576460847178632334', '8']} This doesn't look like a CSV file at all... Is that what you actually have in the file, or

Re: max(), sum(), next()

2008-09-08 Thread Boris Borcic
David C. Ullrich wrote: (ii) If A is a subset of B then we should have max(A) <= max(B). This requires that max(empty set) be something that's smaller than everything else. So we give up on that. Er, what about instances of variations/elaborations on class Smaller(object) : __cmp__ = lambda

Re: Dictionaries and loops

2008-09-08 Thread bearophileHUGS
Few solutions, not much tested: data = """{None: ['User-ID', 'Count']} {None: ['576460847178667334', '1']} {None: ['576460847178632334', '8']}""" lines = iter(data.splitlines()) lines.next() identity_table = "".join(map(chr, xrange(256))) result = {} for line in lines: parts = line.translate

Re: Dictionaries and loops

2008-09-08 Thread bearophileHUGS
Bruno Desthuilliers: > This doesn't look like a CSV file at all... Is that what you actually > have in the file, or what you get from the csv.reader ??? I presume you are right, the file probably doesn't contain that stuff like I have assumed in my silly/useless solutions :-) Bye, bearophile -- h

Re: Dictionaries and loops

2008-09-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : Bruno Desthuilliers: This doesn't look like a CSV file at all... Is that what you actually have in the file, or what you get from the csv.reader ??? I presume you are right, the file probably doesn't contain that stuff like I have assumed in my silly/useless solutio

Re: firefox timestamp

2008-09-08 Thread Fredrik Lundh
abhilash pp wrote: I don't know if this question will fit on this section, any way my query is , i have used one script demork.py to extract details from Firefox history.dat file and now the problem is how to convert the TIMESTAMP given by that to normal date and time. example timestams are l

Re: Dictionaries and loops

2008-09-08 Thread Mike P
Thanks for the solution above, The raw data looked like User-ID,COUNTS 576460840144207854,6 576460821700280307,2 576460783848259584,1 576460809027715074,3 576460825909089607,1 576460817407934470,1 and i used CSV_INPUT1 = "C:/Example work/Attr_model/Activity_test.csv" fin1 = open(CSV_INPUT1, "rb"

Catching subprocess stdout stream

2008-09-08 Thread Thomas Jansson
Dear all I have tkinkter based frontend to a Fortran based program. I use subprocess to launch the fortran program as a child process and I wish to see the output of the fortran program as it is created in the console. The fortran program can take up to 20 minuttes to finish and at the moment the

Re: Files application architecture

2008-09-08 Thread Benjamin Watine
Bruno Desthuilliers a écrit : Benjamin Watine a écrit : Hi, I'm about to develop a small python application and I wonder how to organize files in this application. I'm familar to java, so I'm tempted to use the same convention http://dirtsimple.org/2004/12/python-is-not-java.html : 1 file

Re: Unable to start a process with subprocess Popen()

2008-09-08 Thread aha
On Sep 8, 7:23 am, [EMAIL PROTECTED] wrote: > On Mon, Sep 8, 2008 at 11:50 AM,  <[EMAIL PROTECTED]> wrote: > > Hi, > > > I'm using the subprocess module's Popen() to start a batch file. This > > batch file basically calls an exe which also gets started. > > Unfortunately, this does not produce any

Re: Dictionaries and loops

2008-09-08 Thread Bruno Desthuilliers
Mike P a écrit : Thanks for the solution above, The raw data looked like User-ID,COUNTS 576460840144207854,6 576460821700280307,2 576460783848259584,1 576460809027715074,3 576460825909089607,1 576460817407934470,1 and i used CSV_INPUT1 = "C:/Example work/Attr_model/Activity_test.csv" fin1 = op

Re: lacking follow-through

2008-09-08 Thread Eric Wertman
> Perhaps the wrong idea of what the group is. I would have thought > that > if one had a sufficiently developed idea and wanted to have it / > formally/ > rejected, rather than merely sniped at, then writting a PEP would be > more > apposite than posting to c.l.py. > > It's fine to post your not

Re: lacking follow-through

2008-09-08 Thread Dan Upton
On Sun, Sep 7, 2008 at 10:59 PM, castironpi <[EMAIL PROTECTED]> wrote: > On Sep 7, 7:34 pm, MRAB <[EMAIL PROTECTED]> wrote: >> On Sep 7, 11:28 pm, "Eric Wertman" <[EMAIL PROTECTED]> wrote: >> >> > +1 Bot >> >> I think it's like duck typing: it doesn't matter whether he's actually >> a bot, only whe

Trying to make a spider using mechanize

2008-09-08 Thread [EMAIL PROTECTED]
Hi, I can read the home page using the mechanize lib. Is there a way to load in web pages using filename.html instad of servername/ filename.html. Lots of time the links just have the file name. I'm trying to read in the links name and then vsit those pages. here is the sample code I am ussing

Re: Test if list contains another list

2008-09-08 Thread Matimus
On Sep 8, 12:32 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > mathieu a écrit : > > > Hi there, > > >   I am trying to write something very simple to test if a list > > contains another one: > > > a = [1,2,3] > > > b = [3,2,1,4] > > > but 'a in b' returns False. > > Indeed. Lists are not set

Re: Unable to start a process with subprocess Popen()

2008-09-08 Thread dudeja . rajat
On Mon, Sep 8, 2008 at 4:43 PM, aha <[EMAIL PROTECTED]> wrote: > On Sep 8, 7:23 am, [EMAIL PROTECTED] wrote: >> On Mon, Sep 8, 2008 at 11:50 AM, <[EMAIL PROTECTED]> wrote: >> > Hi, >> >> > I'm using the subprocess module's Popen() to start a batch file. This >> > batch file basically calls an exe

Calling Common Lisp Game Developers

2008-09-08 Thread jobs
We are currently seeking talented Lisp Game Developers who are passionate about game development and want to play a major role in developing and maintaining new features for one of our persistent browser games. This particular title uses Hunchentoot, but all other code has been developed in house

Calling Common Lisp Game Developers

2008-09-08 Thread jobs
We are currently seeking talented Lisp Game Developers who are passionate about game development and want to play a major role in developing and maintaining new features for one of our persistent browser games. This particular title uses Hunchentoot, but all other code has been developed in house

Problems downloading and installing win32api

2008-09-08 Thread brianrpsgt1
I have attempted downloading and installing several different version of the win32api from Source Forge, however, each time I try to install I get the following error message: "Only part of a ReadProcessMemory or WriteProcessMemory request was completed" This occurred with the following files: py

Re: Read and write binary data

2008-09-08 Thread Kurt Smith
On Sun, Sep 7, 2008 at 5:41 PM, Mars creature <[EMAIL PROTECTED]> wrote: > Hi guys, > I am new to Python, and thinking about migrating to it from matlab > as it is a really cool language. Right now, I am trying to figure out If you're trying to migrate from matlab to python I'd take a look at num

Re: Learning Python

2008-09-08 Thread James Matthews
I like two 1. www.diveintopython.com and 2. Core Python Programming. On Mon, Sep 8, 2008 at 6:15 AM, Alan G Isaac <[EMAIL PROTECTED]> wrote: > On 9/6/2008 5:17 AM James Pilling apparently wrote: > >> Hi im currently starting to learn python in sixth form at school any tips? >> > > The books sugge

Re: universal unicode font for reportlab

2008-09-08 Thread Laszlo Nagy
Iain Dalton wrote: Why don't you want to use multiple typefaces? Many programs that deal with multilingual strings use multiple fonts (cf. any Web browser and Emacs). You are right, but these PDF documents will show mixed strings. The end user can enter arbitrary strings into the database, a

shelve file name extention

2008-09-08 Thread Monu
Hi All, When I am using shelve on my local machine it generates the db file as given filename. But in another machine it's generating .dat and .dir. can anyone tell me how can I force sheve module to write the db in .dir and .dat, instead of ? Do I have to install a specific version of the python?

Re: Read and write binary data

2008-09-08 Thread Mohamed Yousef
I don't know if this is going to help you but a free&open alternative to Matlap is FreeMat just search for it -- http://mail.python.org/mailman/listinfo/python-list

Re: shelve file name extention

2008-09-08 Thread skip
Monu> When I am using shelve on my local machine it generates the db Monu> file as given filename. But in another machine it's generating Monu> .dat and .dir. can anyone tell me how can I force sheve Monu> module to write the db in .dir and .dat, Monu> instead of ? Do I have t

Re: [ANN] pysqlite 2.5.0 released

2008-09-08 Thread Petite Abeille
On Sep 8, 2008, at 1:56 PM, Gerhard Häring wrote: But AFAIK it's possible to compile a custom SQLite with appropriate flags to ./configure that will include the fulltext search extension. It's indeed rather straightforward to integrate FTS, e.g.: % CFLAGS="-DSQLITE_ENABLE_FTS3=1" ./configur

exit()

2008-09-08 Thread Gary Robinson
In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() But I don't see exit() mentioned as a built-in function; rather the Python Library Reference says we should use sys.exit(). Also, the reference says sys.exit() is like raising SystemExit. But so is j

Re: exit()

2008-09-08 Thread Christian Heimes
Gary Robinson wrote: In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() The exit callable is defined in the site module. Check out site.py! It shouldn't be used in code. It was added to help newbies to 'escape' from an interactive Python shell.

Re: lacking follow-through

2008-09-08 Thread Chris Rebert
On Mon, Sep 8, 2008 at 9:03 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: >> Perhaps the wrong idea of what the group is. I would have thought >> that >> if one had a sufficiently developed idea and wanted to have it / >> formally/ >> rejected, rather than merely sniped at, then writting a PEP would

Re: exit()

2008-09-08 Thread Jean-Paul Calderone
On Mon, 08 Sep 2008 21:03:48 +0200, Christian Heimes <[EMAIL PROTECTED]> wrote: Gary Robinson wrote: In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() The exit callable is defined in the site module. Check out site.py! It shouldn't be used in cod

Re: max(), sum(), next()

2008-09-08 Thread castironpi
On Sep 8, 8:54 am, Boris Borcic <[EMAIL PROTECTED]> wrote: > David C. Ullrich wrote: > > > (ii) If A is a subset of B then we should have > > max(A) <= max(B). This requires that max(empty set) > > be something that's smaller than everything else. > > So we give up on that. > > Er, what about insta

Re: lacking follow-through

2008-09-08 Thread castironpi
On Sep 8, 11:23 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Sun, Sep 7, 2008 at 10:59 PM, castironpi <[EMAIL PROTECTED]> wrote: > > On Sep 7, 7:34 pm, MRAB <[EMAIL PROTECTED]> wrote: > >> On Sep 7, 11:28 pm, "Eric Wertman" <[EMAIL PROTECTED]> wrote: > > >> > +1 Bot > > >> I think it's like duck

Re: lacking follow-through

2008-09-08 Thread castironpi
On Sep 8, 2:04 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Mon, Sep 8, 2008 at 9:03 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: > >> Perhaps the wrong idea of what the group is.  I would have thought > >> that > >> if one had a sufficiently developed idea and wanted to have it / > >> formall

Re: lacking follow-through

2008-09-08 Thread Grant Edwards
On 2008-09-08, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Mon, Sep 8, 2008 at 9:03 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: > >> To expand on this a little bit, I've been subscribed to this >> group for a couple of months, but there seems to be a bit more >> gray area between what would go to

Re: How to run PyOS_InputHook from python code (i.e. yield to event loops)

2008-09-08 Thread Sean DiZazzo
On Sep 6, 1:00 pm, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Background: PyOS_InputHook is something that gets run when python is > doing raw_input. TkInter and friends use it to run their event loops, > so that their events are handled while python is doing raw_input. > > What I'd like to do is

Re: Problems downloading and installing win32api

2008-09-08 Thread Emile van Sebille
brianrpsgt1 wrote: I have attempted downloading and installing several different version of the win32api from Source Forge, Whe win32 tools come bundled with ActiveState's python distribution. Maybe that'll move you forward... Emile however, each time I try to install I get the following

finding the parent class (not superclass) of the currently executing method derived from a Borg class

2008-09-08 Thread seanacais
I want to create a class derived from a Borg class that can instantiated as part of a script or be contained in other classes. When methods from the Borg class are called, I would like to know the name of the class that contains the Borg class. I've played a bit with inspect and _getframe from th

Re: Updating python dictionary

2008-09-08 Thread [EMAIL PROTECTED]
On Sep 8, 10:20 am, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 8, 10:47 am, MK Bernard <[EMAIL PROTECTED]> wrote: > > > > > On Sep 7, 3:37 pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Sep 8, 7:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > Hello... > > > > > I have a

Re: lacking follow-through

2008-09-08 Thread Terry Reedy
Chris Rebert wrote: On Mon, Sep 8, 2008 at 9:03 AM, Eric Wertman <[EMAIL PROTECTED]> wrote: To expand on this a little bit, I've been subscribed to this group for a couple of months, but there seems to be a bit more gray area between what would go to a 'python-dev' group and a 'python-user

Re: universal unicode font for reportlab

2008-09-08 Thread Terry Reedy
The simplest solution would be to use a font that is able to handle all encodings that I need. My OpenOffice on WinXP uses a unicode font, I believe Lucida Sans Unicode, that seems to cover the entire BMP. I don't know whether it was already installed or installed by OO or how one would get

Re: hashing an array - howto

2008-09-08 Thread Robert Kern
[EMAIL PROTECTED] wrote: John Machin: Consider this:>>> hash(123) == hash(123.0) == hash(123L) True Right... Can you explain me why Python designers have chosen to build a hash() like that? Because that's the kind of hash that dicts expect. If two objects are equal (i.e. (x==y) is True), th

Re: Where does the command "ls" in some doctest files come from ?

2008-09-08 Thread Terry Reedy
KLEIN Stéphane wrote: Hi, for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ tests.py?rev=89831&view=auto test file, there is this doctests : def develop_verbose(): """ We should be able to deal with setup scripts that aren't setuptools based. >>> mkdir('foo')

The difference between __XX__ and XX method

2008-09-08 Thread AON LAZIO
Hi, Pythoners. I would like to know that in some class, it uses __XX__ but in some it uses only XX for example, class Test: def __som__(self): ... def som(self): ... What does "__XX__" make the method different from XX? Thanks in advance Aonlazio -- http://m

Re: exit()

2008-09-08 Thread nntpman68
Hi Jean-Paul, Jean-Paul Calderone wrote: On Mon, 08 Sep 2008 21:03:48 +0200, Christian Heimes <[EMAIL PROTECTED]> wrote: Gary Robinson wrote: In Python 2.5.2, I notice that, in the interpreter or in a script, I can exit with: exit() The exit callable is defined in the site module. Chec

class(object) and (type)??

2008-09-08 Thread AON LAZIO
Hi again pythoners, I notice in the class of a code having (object) and (type) attached to the name of the class. I know that in other cases, that means the class inherits methods and properties from other but In this case, what does it mean? For example, class PY(object): def __init__(se

Re: The difference between __XX__ and XX method

2008-09-08 Thread James Mills
Hi, This is convention only and typically used to denote that a particular class attribute is "private". Though note, there is really no such thing in Python. cheers James On Tue, Sep 9, 2008 at 7:31 AM, AON LAZIO <[EMAIL PROTECTED]> wrote: > Hi, Pythoners. > I would like to know that in s

Re: Trying to make a spider using mechanize

2008-09-08 Thread James Mills
Hi, Perhaps you might want to try out using a sample spider I wrote and base your code of this ? See: http://hg.shortcircuit.net.au/index.wsgi/pymills/file/b9936ae2525c/examples/spider.py cheers James On Tue, Sep 9, 2008 at 2:24 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi, > > I can

Re: The difference between __XX__ and XX method

2008-09-08 Thread Christian Heimes
AON LAZIO wrote: Hi, Pythoners. I would like to know that in some class, it uses __XX__ but in some it uses only XX for example, class Test: def __som__(self): ... def som(self): ... What does "__XX__" make the method different from XX? Thanks in advance

F2PY ?? Has anyone worked with the F2PY generator?

2008-09-08 Thread Blubaugh, David A.
To All, Has anyone worked with the F2PY generator? This is something that is supposedly built within numpy and scipy for the Python environment. I was wondering if anyone has encountered any issues with this environment?? This is important to find the answers to these questions. Thanks, D

Re: Where does the command "ls" in some doctest files come from ?

2008-09-08 Thread KLEIN Stéphane
Le Mon, 08 Sep 2008 12:51:04 +, Steven D'Aprano a écrit : > On Mon, 08 Sep 2008 12:15:15 +, KLEIN Stéphane wrote: > >> Hi, >> >> for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ >> tests.py?rev=89831&view=auto test file, there is this doctests : > > [snip] > >>

Re: class(object) and (type)??

2008-09-08 Thread Chris Rebert
Subclassing 'object' makes the class new-style as opposed to old-style. object is the ultimate superclass of all new-style classes. Old-style classes are deprecated and will be removed in Python 3.0, but they're currently the default for backward-compatibility reasons. See http://docs.python.org/re

Re: Numeric literal syntax

2008-09-08 Thread Tom Harris
On Thu, Sep 4, 2008 at 10:22 AM, Alexander Schmolck <[EMAIL PROTECTED]> wrote: > > It's amazing that after over half a century of computing we still can't denote > numbers with more than 4 digits readably in the vast majority of contexts. > I agree. So did Forth's early designers. That is why Fort

Re: wxPython problem

2008-09-08 Thread Paul Probert
Peter Anderson wrote: Stef Mientki said: In PyScripter, you should run wxPython in the plain remote machine (not the wxPython remote),and you should set "reset before run flag" or reset the remote machine each time yourself. Stef, Thanks for the help! It has taken several hours to find and in

RE: F2PY ?? Has anyone worked with the F2PY generator?

2008-09-08 Thread Blubaugh, David A.
Pauli, Yes, I am utilizing the windows environment. I cannot install f2py. I obtain the following error when I try to execute the setup.py file within the f2py folder located within the numpy master folder: Warning: Assuming default configuration (lib\parser/{setup_parser,setup}.py was no

Re: lacking follow-through

2008-09-08 Thread Robert Kern
Eric Wertman wrote: Perhaps the wrong idea of what the group is. I would have thought that if one had a sufficiently developed idea and wanted to have it / formally/ rejected, rather than merely sniped at, then writting a PEP would be more apposite than posting to c.l.py. It's fine to post your

Re: Updating python dictionary

2008-09-08 Thread John Machin
On Sep 9, 6:12 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: [big snip] > In the interests of academia (although this isn't homework :)) I'll > answer some of those questions: Understanding your own requirements is , I would have thought, not much to do with "academia" but a very practical id

Re: Where does the command "ls" in some doctest files come from ?

2008-09-08 Thread Steven D'Aprano
On Mon, 08 Sep 2008 22:04:29 +, KLEIN Stéphane wrote: >> You found the ls() function in a docstring from Zope. The doctest seems >> to be testing ls(). That suggests to me that ls() is defined in Zope, >> not doctest. > > Well, ls() is one test utility function defined in zc.buildout.testing

Re: Coming from .NET and VB and C

2008-09-08 Thread benlindelof
BigTable looks great! There's a 3% performance hit for these types of databases. However it makes up for it in other ways. "Dive Into Python" seems to suggest there is less busy work, but I am still looking into the GUI components of Python. Say, a grid of 10x10 tiles of PNGs. ___

Re: F2PY ?? Has anyone worked with the F2PY generator?

2008-09-08 Thread [EMAIL PROTECTED]
On Sep 8, 7:19 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > Pauli, > > Yes,  I am utilizing the windows environment.  I cannot install f2py.   > > I obtain the following error when I try to execute the setup.py file > within the f2py folder located within the numpy master folder: You shou

  1   2   >