Re: strange note in fcntl docs

2005-01-17 Thread John Lenton
would go against what I understand is the essence of os.open (i.e., a direct road to open(2)). Hmm, if the above sounds a little harsh, sprinkle :)s in. I've had too little sleep. -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: If you're right 90% of the time, why quibble about

Re: Assigning to self

2005-01-17 Thread John Roth
tm The first reference contains an example of how to do a singleton: simply search on the word Singleton. John Roth Cheers, Frans -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread John Roth
"Frans Englich" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Monday 17 January 2005 20:03, John Roth wrote: "Frans Englich" <[EMAIL PROTECTED]> wrote in message In other words, you're trying to create a singleton. In general, singletons are

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Roth
irst place I'd look. The postal service has a major interest in having addresses that they can deliver without a lot of hassle. Another place is google. The first two pages using "Address Matching software" gave two UK references, and several Australian references. John Roth -- Andrew McLean -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Machin
d to the OP: (1) Your solution doesn't handle the case where the postal code has been butchered. e.g. "DT8 BEL" or "OT8 3EL". (2) I endorse John Roth's comments. Validation against an address data base that is provided by the postal authority, using either an out-sourced bure

Re: Fuzzy matching of postal addresses

2005-01-17 Thread John Machin
You can't even get anywhere near 100% accuracy when comparing "authoritative sources" e.g. postal authority and the body charged with maintaining a database of which streets are in which electoral district -- no, not AUS, but close :-) -- http://mail.python.org/mailman/listinfo/python-list

[wxpython] exclude files in a wx.FileDialog?

2005-01-18 Thread John Field
Hello, Is it possible to exclude certain files in a wx.FileDialog, so that the user won't see them and can't select them with the mouse in de File open window? I was thinking of somehow extending the class FileDialog(Dialog) in the wx module _windows.py to a subclass, but I'm not sure how to d

Re: strange note in fcntl docs

2005-01-18 Thread John Lenton
On Mon, Jan 17, 2005 at 09:54:46PM -0600, Skip Montanaro wrote: > > John> And, even if they were, the note is *still* wrong and misleading: > John> fcntl is available on Windows, and os.open's flags won't be. > > Does this read better? > >

Re: lambda

2005-01-18 Thread John Lenton
On Mon, Jan 17, 2005 at 03:20:01PM +, Antoon Pardon wrote: > Op 2005-01-17, John Lenton schreef <[EMAIL PROTECTED]>: > > > > knowledgeable and experienced users know when to ignore the rules. > > Then why seems there to be so few acknowledgement that these rule

Re: One-Shot Property?

2005-01-18 Thread John Lenton
cing it with the computed value of the property. Line 9 shows that it worked, line 11 shows that it didn't break the class, and line 13 (through the absence of an exception) shows that it no longer is 'special' (as it shouldn't be). -- John Lenton ([EMAIL PROTECTED]) -

Re: Fuzzy matching of postal addresses

2005-01-18 Thread John Machin
John Machin wrote: > Ermmm ... only remove "the" when you are sure it is a whole word. Even > then it's a dodgy idea. In the first 1000 lines of the nearest address > file I had to hand, I found these: Catherine, Matthew, Rotherwood, > Weatherall, and "The Avenue&

Re: Fuzzy matching of postal addresses

2005-01-18 Thread John Roth
th or without house number), building name and flat or room number that there's a difficulty. We always had a list of keywords that could be trusted to be delimiters. In your examples, "the" should be pretty reliable in indicating a building name. Of course, that might have some trou

Re: file copy portability

2005-01-18 Thread John Machin
Bob Smith wrote: > Is shutil.copyfile(src,dst) the *most* portable way to copy files with > Python? I'm dealing with plain text files on Windows, Linux and Mac OSX. > > Thanks! Portable what? Way of copying?? Do you want your files transferred (a) so that they look like native text files on the

Re: simultaneous multiple requests to very simple database

2005-01-19 Thread John Lenton
ctionary, and it isn't sql. The use you have in mind is a bit more complicated than the simple create-me-a-dictionary-in-a-file, but is pretty straightforward. The documentation mostly refers you to the C API, but fortunately it (the C API) is clear and well written. HTH -- John Lenton ([EMAI

Re: [OT] Good C++ book for a Python programmer

2005-01-19 Thread John Hunter
> "Philippe" == Philippe C Martin <[EMAIL PROTECTED]> writes: Philippe> I suggest you google 'C++ tutorial' Regards, Stroustup's "The C++ Programming Language" is the best C++ book I've read. It is at a fairly high level, and I already had read several C++ books before reading it, so it

Re: Python and Excel

2005-01-19 Thread Simon John
Hmm, sounds interesting, I've always resorted to using CSV (or even HTML!) when exporting to Excel. As far as how to open it up, have a look at creating a project on www.sourceforge.net or just zip it up and bung it on your own website if you have one. I've got the feeling there are also Python-sp

Re: getting a class attribute using a keyword argument

2005-01-19 Thread John Hsu
Guy Robinson wrote: Hello, I have a list of class instances. I wish to get the appropriate class attribute in each class instance depending on a SINGLE keyword in the calling class. How do I get the calling method to correctly recognise the keyword as a keyword and not a class attribute? See ex

Re: list item's position

2005-01-19 Thread John Machin
On Wed, 19 Jan 2005 22:02:51 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > >See Mark's post, if you "need to know the index of something" this is >the perfect case for enumerate (assuming you have at least Python 2.3): But the OP (despite what he says) _doesn't_ need to know the index of th

Re: QOTW from Ryan Tomayko

2005-01-20 Thread John Roth
cquired taste, and they are one I've never acquired regardless of the environment. I've used both edit under TSO and vi on a timesharing arrangement with an AIX system, and both of them suck compared to the screen editors available. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with import pylab from a website

2005-01-20 Thread John Hunter
> "jean" == jean rossier <[EMAIL PROTECTED]> writes: jean> Hello All, I am facing a problem while importing pylab jean> library(in a .py program file) via web browser however the jean> same program works when I execute it from the command jean> prompt. jean> Error message

Is there a library to parse Mozilla "mork" documents?

2005-01-20 Thread John Reese
Mozilla, Firefox, Thunderbird, and so forth use this awful format called MORK to store all kinds of things: which messages you've read in a newsgroup, headers and indexes into the mbox file of messages in a mail folder, and address books. It's documented to some extent here: http://www.mozilla.org

Re: why no time() + timedelta() ?

2005-01-20 Thread John Machin
Tim Peters wrote: > [josh] > > Why can't timedelta arithmetic be done on time objects? > > Obviously, because it's not implemented . > > > (e.g. datetime.time(5)-datetime.timedelta(microseconds=3) > > > > Nonzero "days" of the timedelta could either be ignored, or > > trigger an exception. > > And

Re: Unbinding multiple variables

2005-01-20 Thread John Hunter
Johnny> command using del or something like that that will iterate Johnny> the list and unbind each of the variables? Hi Johnny I assume you are the one and only Johnny Lin at the U of C, no? John-Hunters-Computer:~> python Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 2003

Re: problems with duplicating and slicing an array

2005-01-20 Thread John Hunter
> "Yun" == Yun Mao <[EMAIL PROTECTED]> writes: Yun> 2. Is there a way to do Matlab style slicing? e.g. if I have Yun> i = array([0, 2]) x = array([1.1, 2.2, 3.3, 4.4]) I wish y = Yun> x(i) would give me [1.1, 3.3] Now I'm using map, but it gets Yun> a little annoying when there

Re: Unbinding multiple variables

2005-01-20 Thread John Machin
Johnny Lin wrote: > Hi! > > Is there a way to automate the unbinding of multiple variables? Say I > have a list of the names of all variables in the current scope via > dir(). Is there a command using del or something like that that will > iterate the list and unbind each of the variables? Yes.

Re: how to write a tutorial

2005-01-21 Thread John Hunter
> "Xah" == Xah Lee <[EMAIL PROTECTED]> writes: Xah> at places often a whole paragraph on some so called computer Xah> science jargons should be deleted. They are there more to Xah> showcase inane technicality than do help the Xah> reader. (related, many passages with jargons sh

Re: Simple (newbie) regular expression question

2005-01-21 Thread John Machin
ython identifier that starts and ends with two [implicitly, or more] underscores". In the two alternative patterns, the part in the middle says "zero or more instances of a character that can appear in the middle of a Python identifier". The first pattern spells this out as "capital letters, small letters, digits, and underscore". The second pattern uses the \w shorthand to give the same effect. You should be able to follow that from the Python documentation. Now, read this: http://www.amk.ca/python/howto/regex/ HTH, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Graph and Table implementation

2005-01-21 Thread John Hunter
> "Jan" == Jan Rienyer Gadil <[EMAIL PROTECTED]> writes: Jan> could anyone please help me! what and how is the best Jan> implementation of creating a table based on data coming from Jan> the serial port ? and also how would i be able to create Jan> graphs (2D) based on these d

Re: Is there a library to parse Mozilla "mork" documents?

2005-01-21 Thread John Reese
On Thu, 20 Jan 2005 23:48:34 -0800, Tim Roberts <[EMAIL PROTECTED]> wrote: > John Reese <[EMAIL PROTECTED]> wrote: >> >>Mozilla, Firefox, Thunderbird, and so forth use this awful format >>called MORK to store all kinds of things: which messages you've read

Re: why am I getting a segmentation fault?

2005-01-21 Thread John Machin
Jay donnell wrote: > I have a short multi-threaded script that checks web images to make > sure they are still there. I get a segmentation fault everytime I run > it and I can't figure out why. Writing threaded scripts is new to me so > I may be doing something wrong that should be obvious :( >

Re: why am I getting a segmentation fault?

2005-01-21 Thread John Machin
on't know what caused the segfault. That means you don't know how to avoid it in the future. You are still living in the shadow of the volcano. Will the chicken trick work next time? Looking forward to the next episode, John -- http://mail.python.org/mailman/listinfo/python-list

Re: getting file size

2005-01-21 Thread John Machin
Bob Smith wrote: > Are these the same: > > 1. f_size = os.path.getsize(file_name) > > 2. fp1 = file(file_name, 'r') > data = fp1.readlines() > last_byte = fp1.tell() > > I always get the same value when doing 1. or 2. Is there a reason I > should do both? When reading to the end of a file,

Re: getting file size

2005-01-23 Thread John Machin
Tim Roberts wrote: > Bob Smith <[EMAIL PROTECTED]> wrote: > > >Are these the same: > > > >1. f_size = os.path.getsize(file_name) > > > >2. fp1 = file(file_name, 'r') > >data = fp1.readlines() > >last_byte = fp1.tell() > > > >I always get the same value when doing 1. or 2. Is there a reason

Re: getting file size

2005-01-23 Thread John Machin
Tim Roberts wrote: > Bob Smith <[EMAIL PROTECTED]> wrote: > > >Are these the same: > > > >1. f_size = os.path.getsize(file_name) > > > >2. fp1 = file(file_name, 'r') > >data = fp1.readlines() > >last_byte = fp1.tell() > > > >I always get the same value when doing 1. or 2. Is there a reason

Re: OT: problems mirroring python-list to c.l.py?

2005-01-23 Thread John Lenton
in a public forum, and *you* should know better than to go around flapping your mouth like that. -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: Comer se ha de hacer en silencio, como los frailes en sus conventos. signature.asc Description: Digital signature -- http://mail.python.org/mailman/listinfo/python-list

Re: Fuzzy matching of postal addresses [1/1]

2005-01-23 Thread John Machin
the expense of a little more complexity, one can reduce this to one row and 3 variables (north, northwest, and west) corresponding to d[i-1][j], d[i-1][j-1], and d[i][j-1] -- but I'd suggest the simple way first. Hope some of this helps, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Set parity of a string

2005-01-23 Thread John Machin
Peter Hansen wrote: > snacktime wrote: > > Is there a module that sets the parity of a string? I have an > > application that needs to communicate with a host using even parity > > So what I need is before sending the message, convert it from space to > > even parity. And when I get the respons

Re: "bad argument type for built-in operation"

2005-01-24 Thread John Machin
erally, are you testing the returned value from each and every C API call? Are you testing for the correct error value (some return NULL, some -1, ...)? Are you doing the right thing on error? A catalogue of the different ways of messing things up using C would take forever to write. If you ca

Re: Looking for Form Feeds

2005-01-24 Thread John Machin
simple as: if input_line[:2] == "\r\f": BTW, have you checked that there are no other control characters embedded in the file, e.g. ESC (introducing an escape sequence), SI/SO (change character set), BEL * 100 (Hey, Fred, the printout's finished), HT, VT, BS (yeah, probably lots of that, but I mean BackSpace)? HTH, John -- http://mail.python.org/mailman/listinfo/python-list

ANN: matplotlib-0.71

2005-01-25 Thread John Hunter
matplotlib is a 2D graphics package that produces plots from python scripts, the python shell, or embeds them in your favorite python GUI -- wx, gtk, tk, fltk currently supported with qt in the works. Unlike many python plotting alternatives is written in python, so it is easy to extend. matplotli

Re: Browsing text ; Python the right tool?

2005-01-25 Thread John Machin
Paul Kooistra wrote: > I need a tool to browse text files with a size of 10-20 Mb. These > files have a fixed record length of 800 bytes (CR/LF), and containt > records used to create printed pages by an external company. > > Each line (record) contains an 2-character identifier, like 'A0' or > 'C

Re: Browsing text ; Python the right tool?

2005-01-25 Thread John Machin
Paul Kooistra wrote: > I need a tool to browse text files with a size of 10-20 Mb. These > files have a fixed record length of 800 bytes (CR/LF), and containt > records used to create printed pages by an external company. > > Each line (record) contains an 2-character identifier, like 'A0' or > 'C

Re: How to input one char at a time from stdin?

2005-01-25 Thread John Machin
On Wed, 26 Jan 2005 01:15:10 +0530, Swaroop C H <[EMAIL PROTECTED]> wrote: >On Tue, 25 Jan 2005 12:38:13 -0700, Brent W. Hughes ><[EMAIL PROTECTED]> wrote: >> I'd like to get a character from stdin, perform some action, get another >> character, etc. If I just use stdin.read(1), it waits until I

Re: Browsing text ; Python the right tool?

2005-01-25 Thread John Machin
(and chuck an exception if it won't fit). Slightly better than an approach that uses something like nbytes = sprintf(buffer, "%04d%-20s%-5s", a0_num, a0_phone, a0_zip); HTH, John -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP Server

2005-01-26 Thread John Abel
y will get fixed/added. For what it's worth, I have a medusa-based FTP server running on Linux (daemon) and Win32 (service), without any problems at all. John -- http://mail.python.org/mailman/listinfo/python-list

Re: FTP Server

2005-01-26 Thread John Abel
If you're after a simple FTP server, have a look at medusa. Regards John [EMAIL PROTECTED] wrote: What's the simplest way to write an FTP Server in Python? A short research on the newsgroup and on the Cookbook did not bring out anything relevant (but I hear a little voice in the back

detect tk mainloop

2005-01-26 Thread John Hunter
In matplotlib using the tkagg backend, the tk mainloop is started at the end of a python script by issuing a call to a "show" function, which realizes all the created figure windows and the calls Tkinter.mainloop(). This can cause problems if the mainloop was started by another module (eg idle).

Re: Browsing text ; Python the right tool?

2005-01-26 Thread John Machin
Jeff Shannon wrote: > John Machin wrote: > > > Jeff Shannon wrote: > > > >> [...] If each record is CRLF terminated, then > >>you can get one record at a time simply by iterating over the file > >>("for line in open('myfile.dat'

Re: Responding to trollish postings.

2005-01-26 Thread John Machin
Terry Reedy wrote: > > No offense taken. My personal strategy is to read only as much of trollish > threads as I find interesting or somehow instructive, almost never respond, > and then ignore the rest. I also mostly ignore discussions about such > threads. > Indeed. Let's just nominate XL to

Re: python without OO

2005-01-26 Thread John Hunter
ual problem, which is probably not OO programming, but colleagues who are making a design more complex than need be. Indeed, the third chant in the mantra of python is "Simple is better than complex." John-Hunters-Computer:~> python Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3

Re: python without OO

2005-01-26 Thread John Hunter
> "beliavsky" == beliavsky <[EMAIL PROTECTED]> writes: beliavsky> I think the OO way is slightly more obscure. It's beliavsky> obvious what x = reverse(x) does, but it is not clear beliavsky> unless you have the source code whether x.reverse() You don't need to read the src, you

Re: Why do look-ahead and look-behind have to be fixed-width patterns?

2005-01-27 Thread John Machin
inhahe wrote: > Hi i'm a newbie at this and probably always will be, so don't be surprised > if I don't know what i'm talking about. > > but I don't understand why regex look-behinds (and look-aheads) have to be > fixed-width patterns. > > i'm getting the impression that it's supposed to make sear

Re: Installing Numeric with ATLAS and LAPACK

2005-01-28 Thread John Hunter
> "drife" == drife <[EMAIL PROTECTED]> writes: drife> Hello, Could someone please provide instructions for drife> install Numeric with ATLAS and LAPACK? Locate libcblas.a and add that dir to the setup.py library_dirs_list. Eg on my system, /usr/local/lib/ATLAS/lib/Linux_P4SSE2_2/libc

handling xls with pyuno

2005-01-28 Thread John Hunter
Does anyone have any example scripts using the OpenOffince python-bridge module pyuno to load xls, extract the data, and/or save to another format such as xsc or csv. Thanks, JDH -- http://mail.python.org/mailman/listinfo/python-list

Re: Installing Numeric with ATLAS and LAPACK

2005-01-28 Thread John Hunter
>>>>> "drife" == drife <[EMAIL PROTECTED]> writes: drife> Thanks John. Those are the steps I followed, and to no drife> avail. Make sure you get a clean build by rm -rf ing the build dir before you build again. Then capture the output of your

Re: py.dll for version 2.2.1 (Windows)

2005-01-28 Thread John Machin
good reason to stay with 2.2, then get the _latest_ version of that (2.2.3). Otherwise, install 2.4. Regards, John -- http://mail.python.org/mailman/listinfo/python-list

Re: LinearAlgebra incredibly slow for eigenvalue problems

2005-01-28 Thread John Hunter
> "drife" == drife <[EMAIL PROTECTED]> writes: drife> Hi David, I performed the above check, and sure enough, drife> Numeric is --not-- linked to the ATLAS libraries. drife> I followed each of your steps outlined above, and Numeric drife> still is not linking to the ATLAS lib

Re: Pystone benchmark: Win vs. Linux (again)

2005-01-28 Thread Simon John
Franco Fiorese wrote: > Is there any way, that you know, to get better performance under Linux? Build Python yourself, using relevant CFLAGS and TARGET for your processor? I've always noticed that Windows Python takes a lot longer to startup than Linux, but never really looked at runtime perform

python and gpl

2005-01-30 Thread John Hunter
I have a question about what it takes to trigger GPL restrictions in python code which conditionally uses a GPL library. Here is the context of my question. matplotlib, which I develop, is a plotting module which is distributed under a PSF compatible license, and hence we avoid using GPLd code s

Re: barchart for webpage needed

2005-01-31 Thread John Hunter
> "dimitri" == dimitri pater <[EMAIL PROTECTED]> writes: dimitri> Hello, I am looking for a Python tool to create graphs dimitri> and charts on a webpage. Chartdirector is too expensive dimitri> for me. A simple script for creating a barchart should be dimitri> sufficient as a

Re: Python's idiom for function overloads

2005-01-31 Thread John Hunter
> "Frans" == Frans Englich <[EMAIL PROTECTED]> writes: Frans> Hello, Frans> Since Python doesn't have static typing, how is the same Frans> result as traditional function overloads results in Frans> acheived? With function overloads the "selection of code Frans> path depen

Re: implicit conversion

2005-02-01 Thread John Lenton
gt; > Can someone help me please? as later on you say you have a constructor to convert longs into your bigints, you should add a __coerce__ method to your class. General description of __coerce__: http://docs.python.org/ref/numeric-types.html#l2h-303 details on coercion rules: htt

Re: import doesn't work as i want

2005-02-01 Thread John Lenton
On Mon, Jan 31, 2005 at 04:52:24PM +0100, Olivier Noblanc ATOUSOFT wrote: > Hello, > > In the botom of this post you will see my source code. > > The problem is when i launch main.py that doesn't make anything why > ? I'm guessing you don't have an __init__.py

Re: Awkwardness of C API for making tuples

2005-02-01 Thread John Machin
Dave Opstad wrote: > One of the functions in a C extension I'm writing needs to return a > tuple of integers, where the length of the tuple is only known at > runtime. I'm currently doing a loop calling PyInt_FromLong to make the > integers, What is the purpose of this first loop? In what variabl

Re: Next step after pychecker

2005-02-01 Thread John Roth
n find on Google is a blog entry (by Ted Leung) on Aug 30 saying he wished someone would give the author some money to finish it and publish it. John Roth -- http://mail.python.org/mailman/listinfo/python-list

Re: Awkwardness of C API for making tuples

2005-02-01 Thread John Machin
Dave Opstad wrote: > In article <[EMAIL PROTECTED]>, > "John Machin" <[EMAIL PROTECTED]> wrote: > > > What is the purpose of this first loop? > > Error handling. If I can't successfully create all the PyInts then I can > dispose the on

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-02 Thread John Machin
Leeuw van der, Tim TOP-POSTED: > Hi all, > > I can use this version of gtk and PyGtk to run simple programs. There seems to be no problem with the code-completion in PythonWin. > I can do: dir(gtk) without problems after importing the gtk module of PyGtk, when I use idle or console. (Python versio

Re: Reference count question

2005-02-02 Thread John Machin
Fredrik Lundh wrote: > > >PyList_SetItem(List,i,Str); > > you should check the return value, though. PyList_SetItem may (in > theory) fail. > :-) Only a bot could say that. We mere mortals have been known to do things like (a) pass a non-list as the first argument (b) pass an out-of-range va

Re: Integrated Testing - Peppable?

2005-02-02 Thread John Roth
e plugins that do this for JUnit; they don't require any changes to Java in order to function. They just require JUnit, which is pretty ubuquitous. Second, is that the IDEs aren't part of Python proper. Outside of that, it's might be quite a good idea to do something similar with unittest, doctest or py.test. John Roth Peace, --Carl -- http://mail.python.org/mailman/listinfo/python-list

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-03 Thread John Machin
Leeuw van der, Tim wrote: > >> > Do you have a file called drwtsn32.log anywhere on your computer? > > No, unfortunately I cannot find such file anywhere on my computer > > What do I do to get such file? Or anything equally useful? > On my Windows 2000 box, just crash something :-) Perhaps t

exporting mesh from image data

2005-02-03 Thread John Hunter
I am trying to generate a mesh for a finite volume solver (gambit, fluent) from 3D image data (CT, MRI). To generate the fluent msh file, you need not only a list of vertices and polygons, much like what is available in the vtk file format, but also the volume elements in the mesh that the polygo

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-03 Thread John Machin
Leeuw van der, Tim wrote: > > > > > > -Original Message- > > From: [EMAIL PROTECTED] on behalf of John Machin > > Sent: Thu 2/3/2005 12:00 PM > > To: python-list@python.org > > Subject: Re: Crashing Python interpreter! (windows XP, python2.3.4,

Re: Crashing Python interpreter! (windows XP, python2.3.4, 2.3.5rc1, 2.4.0)

2005-02-03 Thread John Machin
Leeuw van der, Tim wrote: > > > > > > -Original Message- > > From: [EMAIL PROTECTED] on behalf of John Machin > > Sent: Thu 2/3/2005 12:00 PM > > To: python-list@python.org > > Subject: Re: Crashing Python interpreter! (windows XP, python2.3.4,

Re: how to generate SQL SELECT pivot table string

2005-02-03 Thread John Machin
McBooCzech wrote: > Hallo all, > > I am trying to generate SQL SELECT command which will return pivot > table. The number of column in the pivot table depends on the data > stored in the database. It means I do not know in advance how many > columns the pivot table will have. > > For example I will

Re: [Fwd: [gnu.org #220719] Re: python and gpl]

2005-02-03 Thread John Hunter
> "Paul" == Paul Rubin <"http://phr.cx"@NOSPAM.invalid> writes: Paul> Various possible candidates for such dragging have Paul> apparently decided that their chances weren't too good. Or simply that it wasn't worth the cost to go to court, even if they presumed they would eventually wi

Re: Converting a string to a function pointer

2005-02-04 Thread John Machin
On Fri, 04 Feb 2005 12:01:35 +0100, HÃ¥kan Persson <[EMAIL PROTECTED]> wrote: >Hi. > >I am trying to "convert" a string into a function pointer. >Suppose I have the following: > >from a import a >from b import b >from c import c > >funcString = GetFunctionAsString() > >and funcString is a string th

Re: Extreme Python

2005-02-04 Thread John Roth
wsgroup or on the regular extremeprogramming list. John Roth PyFIT maintainer. Extremeprogramming mailing list moderator (1 of 7) <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hello all, I've created a web/email group for topics related to both Extreme Programming (or othe

Re: exporting mesh from image data

2005-02-04 Thread John Hunter
> "Fernando" == Fernando Perez <[EMAIL PROTECTED]> writes: Fernando> I hope you posted this on the VTK list with a CC to Fernando> Prabhu as well... The hopes of a positive reply there Fernando> are, I suspect, a fair bit higher. The scipy list would Fernando> be a good idea,

Re: newbie: Syntax error

2005-02-04 Thread John Machin
ith Defensive Programming hint #2: Get into this habit early: !if tries == 1: !blah_blah() !elif tries == 2: !yadda_yadda() !else: !raise Exception, "Can't happen :-) tries has unexpected value (%r)" % tries > print "heads: " + heads Ugh; did you get that out of the book? Try: !print "heads:", heads > print "tails: " + tails > > raw_input("Press enter to quit") HTH, John -- http://mail.python.org/mailman/listinfo/python-list

WYSIWYG wxPython "IDE"....?

2005-02-04 Thread Simon John
I'm writing my 2nd large wxPython program, and after the problems I found doing the first's layout in code, I'd like to look at using a 'WYSIWYG' IDE, like VisualStudio does for MFC. I've tried a few that I found, wxGlade is probably the best, although it seems to be not 100% WYSIWYG (like the wid

Re: Error!

2005-02-04 Thread John Machin
"charge". You forgot to add in the base price -- "actual price" according to you comprises only the taxes and fees. Where is your car yard? We'd each like to order a nice shiny red Ferrari :-) Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: Medical GUI Application With Python

2005-02-05 Thread John Hunter
> "Evrim" == Evrim Ozcelik <[EMAIL PROTECTED]> writes: Evrim> We are developing a medical software about PSG Evrim> (PolySomnoGraphy) analysis. The application takes signal Evrim> data from an electronic device and we will show this Evrim> continious signal function on the inte

Re: a type without a __mro__?

2005-02-05 Thread John Lenton
bute__(attr) class D(object): __metaclass__ = C instances of D have a type that behaves as if it didn't have a __mro__. This isn't exactly what you asked for, but it might be enough. -- John Lenton ([EMAIL PROTECTED]) -- Random fortune: El tiempo cura los dolores y las querellas porq

Re: extreme newbie

2005-06-18 Thread John Machin
ied system-central DLL-equivalent; my guess is that doing so would have prevented easy testing of the "stop working" code on a shared machine where they couldn't change the system date without upsetting other users, and it's probable they were using a Trojan today()-equivalent gadget to supply "old" dates for testing. Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-18 Thread John Machin
quot; Funny that, the class repr()s are different; not in a meaningful way, but the mere difference indicates the classes are products of different manufacturers. (4) Ooooh! How old is the Linux copy of that 3rd party library? (5) Looks like the bug is in RemGui.py -- it is calling super() with an invalid argument. No apparent Python portability problems. > > I'm confused. Confession is good for the soul. However true confession is even better for the soul. Please come up with a better description. :-) === I hope these self-help hints are useful with your next "confusion". Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: struct.(un)pack and ASCIIZ strrings

2005-06-18 Thread John Machin
Terry Reedy wrote: > "Sergey Dorofeev" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I can use string.unpack if string in struct uses fixed amount of bytes. > > > I presume you mean struct.unpack(format, string). The string len must be > known when you call, but need not b

Re: Regex for repeated character?

2005-06-18 Thread John Machin
Terry Hancock wrote: > On Saturday 18 June 2005 02:05 am, John Machin wrote: > >>Doug Schwarz wrote: >> >>>In article <[EMAIL PROTECTED]>, >>> Leif K-Brooks <[EMAIL PROTECTED]> wrote: >>> >>>>How do I make a regular expressi

See Pep 294. was: Re: Why is there no instancemethod builtin?

2005-06-19 Thread John Roth
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > John Roth wrote: > >> you need _both_ isinstance and the types module to do a correct >> check for any string type: isinstance(fubar, types.StringTypes). >> That's becaus

See Pep 315. was: Re: Loop until condition is true

2005-06-19 Thread John Roth
See Pep 315, which is still open, and targeted at 2.5. It survived the recent spate of PEP closings and rejections. http://www.python.org/peps/pep-0315.html John Roth "Remi Villatel" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi there, > > There is

Re: Why is there no instancemethod builtin?

2005-06-19 Thread John Roth
efined for a class that acts like a dictionary: that is, the items are not integers, let alone integers that extend in a strict sequence from 0. John Roth > > George > -- http://mail.python.org/mailman/listinfo/python-list

Re: Using print with format to stdout generates unwanted space

2005-06-19 Thread John Roth
Don't use print, write directly to sys.stdout. Print is not intended for precise output formatting; it's intended for quick outputs that are useable most of the time. John Roth "Paul Watson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > #!/usr/b

Re: catch argc-argv

2005-06-20 Thread John Machin
mg wrote: > Hello, > > I am writting bindings for a FEM application. In one of my function > 'initModulename', called when the module is imported, I would like to > get the argc and argv arguments used in the main function of Python. This is an "interesting" way of writing bindings. Most peopl

Re: catch argc-argv

2005-06-20 Thread John Machin
Duncan Booth wrote: > John Machin wrote: > > >>>So, my question is: does the Python API containe fonctions like >>>'get_argc()' and 'get_argv()' ? >>> >> >>If you can't see them in the documentation, they aren't the

Re: Python choice of database

2005-06-20 Thread John Abel
Gadfly PySQLite ( requires SQLite library ) J Philippe C. Martin wrote: >Hi, > >I am looking for a stand-alone (not client/server) database solution for >Python. > >1) speed is not an issue >2) I wish to store less than 5000 records >3) each record should not be larger than 16K > > >As I start w

Re: Python choice of database

2005-06-20 Thread John Abel
Just thought of a couple more: SnakeSQL KirbyBase J John Abel wrote: >Gadfly >PySQLite ( requires SQLite library ) > >J > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am looking for a stand-alone (not client/server) database solution for >&g

Re: Python choice of database

2005-06-20 Thread John Abel
Philippe C. Martin wrote: >Thank you all for your answers. > >A pure Python would have beenmy first choice. yet I now feel I should spend >some time looking at PySQLite (I like the fact it's pre-compiled for >Windows). > >Thanks. > >Philippe > > > >Philippe C. Martin wrote: > > > >>Hi, >> >>I am

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-20 Thread John Ochiltree
> likely reflects the standard habits of Linux/Unix command naming. I'd heard it was pathologically eclectic rubbish lister, but then you can't believe everything you hear :-) John Ochiltree -- 667 - The Neighbour of the Beast -- http://mail.python.org/mailman/listinfo/python-list

Re: Python and encodings drives me crazy

2005-06-20 Thread John Machin
torch the bad guys, you don't have to write "a little cleanup method". To leave a tombstone for the bad guys: >>> u'abc\u0160def'.encode('macroman', 'replace') 'abc?def' >>> To leave no memorial, only a cognitive gap: >>> u'The Good Soldier \u0160vejk'.encode('macroman', 'ignore') 'The Good Soldier vejk' Do you *really* need to encode it as MacRoman? Can't the Mac app understand utf8? You mentioned cp850 in an earlier post. What would you be feeding cp850-encoded data that doesn't understand cp1252, and isn't in a museum? Cheers, John -- http://mail.python.org/mailman/listinfo/python-list

Re: reading a list from a file

2005-06-20 Thread John Machin
Rune Strand wrote: > But iif it are many lists in the file and they're organised like this: > > ['a','b','c','d','e'] > ['a','b','c','d','e'] > ['A','B','C','D','E'] ['X','F','R','E','Q'] > > I think this'll do it > > data = open('the_file', 'r').read().split(']') > > lists = [] > for el in dat

Re: utf8 silly question

2005-06-21 Thread John Machin
Jeff Epler wrote: > If you want to work with unicode, then write > us = u"\N{COPYRIGHT SIGN} some text" You can avoid almost all the wear and tear on your shift keys: >>> u"\N{copyright sign}" u'\xa9' ... you are stuck with \N for rea

<    8   9   10   11   12   13   14   15   16   17   >