Python and XML?

2007-04-12 Thread Leonard J. Reder
Hello, What is the best way to process a Relax NG Schema and auto generate XML Python parser/generator code? Any suggestions? Thanks for all replies, Len -- === Leonard J. Reder Home office email : [EMAIL PROTECTED] Lab email : [EMAIL PROTECTED] Lab web

Python and JMS?

2007-04-12 Thread Leonard J. Reder
Hello, I would like to write some Python to monitor a JMS middleware software bus. JMS being Java Messaging Service. Can anyone recommend a Python wrapper to JMS for this? My goal is to listen for XML being transfered over a JMS implementation. All the applications so far are in Java. Thank

Re: Problem with algorithm

2007-04-12 Thread Charles Sanders
Paul Rubin wrote: [snip] > > def a(n): > if n==0: > yield '' > return > for c in s: > for r in a(n-1): > yield c+r > > print list(a(3)) Of course, obvious in retrospect, recursion instead of iteration. I have yet to comp

Databases with python

2007-04-12 Thread Anthony Irwin
Hi All, I am interested in playing with python some more and am looking at writing an app with data stored in a database. I have experience with mysql but thought that their may be other better databases that can be more easily distributed with the program does anyone have any suggestions here

Re: Problem with algorithm

2007-04-12 Thread Paul Rubin
Charles Sanders <[EMAIL PROTECTED]> writes: > Forgive any silly mistakes I have made (I've been teaching > myself python for about 1 week) but there is a moderately > well known algorithm for this that extends to arbitrary > lengths of both the list of alternatives and the length > of the required

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-12 Thread Martin v. Löwis
> well, instructions were clear enough for me. What is hard to get why it > could not use free M$ compiler which is presumably produces compatible > objects and libraries. This presumption is incorrect. The compiler does *not* create compatible objects and libraries. It links with msvcr8.dll, wher

Re: Problem with algorithm

2007-04-12 Thread Charles Sanders
[EMAIL PROTECTED] wrote: > On Apr 12, 10:16�pm, "Jia Lu" <[EMAIL PROTECTED]> wrote: >> Hi all. >> �I want to create a large list like: >> >> ~ >> >> Is there any good algorithm to do this? > > Sure. > test = '01' > > for m in test: > for n in test: > for o in test: >

mac IDLE problems

2007-04-12 Thread 7stud
Hi, In the IDLE, I can't get most shortcut keys that are listed next to the menu items to work. For instance, under the Format menu item only the shortcuts for "indent region" and "undent region" work. If I highlight some text and use Shift+3 to comment out the region I highlighted, the code is

Re: UnicodeDecodeError when importing random? (running with -U)

2007-04-12 Thread Robert Kern
Ben wrote: > Is the following a known bug? > > [temp]$ python -U > Python 2.4.4 (#1, Oct 23 2006, 13:58:18) > [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. import random > Traceback (most recent call last): > File

Re: reading from sys.stdin

2007-04-12 Thread Matimus
On Apr 12, 8:20 am, Maric Michaud <[EMAIL PROTECTED]> wrote: > Le jeudi 12 avril 2007 16:25, Matimus a écrit : > > > # Then you check to see if your file is interactive > > if f.isatty(): > > # This is unbuffered, and will iterate the same as f > > f = iter(raw_input(),"") > > This should b

UnicodeDecodeError when importing random? (running with -U)

2007-04-12 Thread Ben
Is the following a known bug? [temp]$ python -U Python 2.4.4 (#1, Oct 23 2006, 13:58:18) [GCC 4.1.1 20061011 (Red Hat 4.1.1-30)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import random Traceback (most recent call last): File "", line 1, in ? File "/u

Re: Using python to delta-load files into a central DB

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 23:51:22 -0300, Chris Nethery <[EMAIL PROTECTED]> escribió: > Yes, they are tab-delimited text files that will change very little > throughout the day. > But, this is messy, antiquated 80s junk, nonetheless. Ugh... > Rows are designated either by a row type or they contain

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > On Apr 12, 5:19 pm, [EMAIL PROTECTED] wrote: >> On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> ... > > After poking around a bit I also discovered the > shutil module. It looks like you can use > shutil.copy2. More Pythonic, yes? > I have seen t

Re: Calling private base methods

2007-04-12 Thread 7stud
On Apr 12, 2:02 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > "7stud" <[EMAIL PROTECTED]> wrote: > > On Apr 12, 5:04 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > >> "7stud" <[EMAIL PROTECTED]> wrote: > >> > On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > >> >> Is it possible to cal

Re: Problem with algorithm

2007-04-12 Thread [EMAIL PROTECTED]
On Apr 12, 10:16�pm, "Jia Lu" <[EMAIL PROTECTED]> wrote: > Hi all. > �I want to create a large list like: > > ~ > > Is there any good algorithm to do this? Sure. test = '01' for m in test: for n in test: for o in test: for p in test: print m+n+o+p

Problem with algorithm

2007-04-12 Thread Jia Lu
Hi all. I want to create a large list like: ~ Is there any good algorithm to do this? Thanx Jia Lu -- http://mail.python.org/mailman/listinfo/python-list

Re: ulimit on open sockets ?

2007-04-12 Thread Alex Martelli
On Apr 12, 2007, at 1:17 PM, Maxim Veksler wrote: ... > Now, someone I work with suggested a simple work around "Pass the list > objects in groups of 1024 each time to the select.select structure". I > think it's acceptable and good advice, the thing is I don't know how > to implement this "th

Re: Using python to delta-load files into a central DB

2007-04-12 Thread Chris Nethery
Gabriel, Thank you for your reply. Yes, they are tab-delimited text files that will change very little throughout the day. But, this is messy, antiquated 80s junk, nonetheless. Rows are designated either by a row type or they contain a comment. Each row type has an identity value, but the 'c

where to report bug/get help for wxpython

2007-04-12 Thread alf
Hi, I have another problem with wxpython - that is the best place to report bug - evident memory leak on Linux and win32. -- alf -- http://mail.python.org/mailman/listinfo/python-list

Re: Custom Python Runtime

2007-04-12 Thread Jack
Gabriel, thanks for the reply. The error is that the DLL can not be found. I think the reason is that the pyd files from pywin32 do not use the python.exe directory. Instead, they expect pywintypes24.dll on the path. "Gabriel Genellina" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED

Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

2007-04-12 Thread alf
Alex Martelli wrote: > I would think this error message is as clear as it can be, and then > some! It even gives very practical advice on how to work around the > problem. Either install VS2003, if you own it or can purchase it, or > else install mingw32 (which is free and can be downloaded) and

mx.ODBC minor problem

2007-04-12 Thread Greg Corradini
Hello all, In a script i just wrote, my code calls a function createTables(), which checks for an existing table and then creates it, and then immediately calls selectSQL(), which selects from a different table and inserts on the table I just created (see below). However, I continue to get an In

Re: Calling private base methods

2007-04-12 Thread Dan Bishop
On Apr 12, 3:02 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: > "7stud" <[EMAIL PROTECTED]> wrote: > > On Apr 12, 5:04 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > >> "7stud" <[EMAIL PROTECTED]> wrote: > >> > On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > >> >> Is it possible to cal

Re: Lists and Tuples and Much More

2007-04-12 Thread Paul McGuire
On Apr 12, 5:38 pm, "Scott" <[EMAIL PROTECTED]> wrote: > I'm going to start grouping all my questions in one post as this is my > second today, and sorta makes me feel dumb to keep having to bother you all > with trivial questions. You might also investigate the python tutorial mailing list, which

wx and SOAPpy interaction

2007-04-12 Thread alf
Hi, there is problem when I import (python 2.4) wx and SOAPpy at the same time. I narrowed the problem to following (on Linux): >>import wx >>import pyexpat Traceback (most recent call last): File "", line 1, in ? ImportError: /apps/public/python_2.4.4/lib/python2.4/lib-dynload/pyexpat.so:

Re: Lists and Tuples and Much More

2007-04-12 Thread Mel Wilson
Scott wrote: > Now I read somewhere that you could change the list inside that tupple. But > I can't find any documentation that describes HOW to do it. The only things > I CAN find on the subject say, "Don't do it because its more trouble than > it's worth." But that doesn't matter to me, be

Re: Using python to delta-load files into a central DB

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 14:05:15 -0300, Chris Nethery <[EMAIL PROTECTED]> escribió: > At present, users of the separate application can run recalculation > functions that modify all 700 files at once, causing my code to take the > whole ball of wax, rather than just the data that has changed. Are t

Re: Several images onto one 2D-plot in matplotlib?

2007-04-12 Thread Alan Isaac
http://matplotlib.sourceforge.net/screenshots.html esp http://matplotlib.sourceforge.net/screenshots/axes_demo.py hth, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Lists and Tuples and Much More

2007-04-12 Thread [EMAIL PROTECTED]
On Apr 12, 5:38 pm, "Scott" <[EMAIL PROTECTED]> wrote: > I'm going to start grouping all my questions in one post as this is my > second today, and sorta makes me feel dumb to keep having to bother you all > with trivial questions. I'll just seperate my questions with: > ---

Emergence of Grok

2007-04-12 Thread Paul McGuire
I just stumbled upon a great-looking project, to make Zope3 more approachable to mere mortals such as myself. Echoing the ROR mantra of "convention over configuration", the Grok project (http:// grok.zope.org/) aims to stand on the shoulders of Zope3, while providing the ease of development of RO

Re: Question About Creating Lists

2007-04-12 Thread James Stroud
Scott wrote: >>Please forgo the psychological self analysis from your future posts. > > > Unfortunately I can't, that's how I am, love it or leave it. But if your > going to be condescending about it, please leave your future replies in your > outbox. Now don't take that as I don't appreciate

Re: [ANN] mlabwrap-1.0final

2007-04-12 Thread Aldarion
Stef Mientki wrote: > What can do MatLab, that can't be done in Python (SciPy) ? > (Ok I accept there's no SimuLink/PowerSim). > What about SVD(Singular value decomposition) for Sparse Matrix. I can't find this in numpy/scipy, someone told me it's in matrix. though I don't know how to get it in

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 5:19 pm, [EMAIL PROTECTED] wrote: > On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > (snipped) > > > import subprocess > retcode = subprocess.call([ "/bin/cp", "-p", oldfile, newfile ]) > On my system, this preserves the access permissions and ownership. > > And if you m

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 4:09 pm, Paulo da Silva <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] escreveu: > > > > > On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: > >> Hi! > > >> I need to process a file to produce another file that *must* have > >> *exactly* the same attributes and permissions of

Re: Lists and Tuples and Much More

2007-04-12 Thread 7stud
> Yes. Tuples are immutable - once created, they can't change. Just to explain that statement a little better. If you do this: t = (1, 2, ["red", "white"]) t[2].append("purple") print t#(1, 2, ['red', 'white', 'purple']) It sure looks like t changed, and therefore t is NOT immutable--and

favourite IDE

2007-04-12 Thread azrael
Some time ago I posted a question about the favourite IDE. I finally found it. WING IDE i the best I've ever seen for python. Code completition is amazing, automated help, python comand line. evrything i need. Who didnt try, doesnt know what he is missing. just one word: Amazing respect to the de

Re: VB6 To Python

2007-04-12 Thread Michael Bentley
On Apr 12, 2007, at 1:11 PM, Sampson, David wrote: Any experience or insight would be great. It has been my experience that when migrating to a dissimilar system, avoiding the rewrite is a mistake. And futile. hth, Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Binary To File

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 20:16:28 -0300, Daniel Nogradi <[EMAIL PROTECTED]> escribió: >> Is there an easy way to take binary data and build it into a file? > > myblob = . # let's say you got it from your database somehow > myjpeg = open( 'image.jpg', 'w' ) > myjpeg.write( myblob ) > myjpeg.cl

Re: Binary To File

2007-04-12 Thread Grant Edwards
On 2007-04-12, Daniel Nogradi <[EMAIL PROTECTED]> wrote: >> Is there an easy way to take binary data and build it into a file? Generally >> this will be BLOB data drawn from a database, the data will be for jpg >> images, I want to take the blob data and build it into a physical .jpg file. >> >> >>

Re: Lists and Tuples and Much More

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 19:38:55 -0300, Scott <[EMAIL PROTECTED]> escribió: > List's and Tuple's > I don't see the distinction between the two. I mean, I understand that a > list is mutable and a tuple is immutable. > The thing that I dont understand about them is what, besides that, > seperates

Re: Lists and Tuples and Much More

2007-04-12 Thread Ben Finney
"Scott" <[EMAIL PROTECTED]> writes: > I'm going to start grouping all my questions in one post as this is > my second today, and sorta makes me feel dumb to keep having to > bother you all with trivial questions. No, please don't do that. Separate questions leading to separate discussions should

Re: "Cloning" file attributes and permissions

2007-04-12 Thread Paulo da Silva
[EMAIL PROTECTED] escreveu: > On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: >> Hi! >> >> I need to process a file to produce another file that *must* have >> *exactly* the same attributes and permissions of the former. What is the >> best way to do this? The file must not exist with

Re: Binary To File

2007-04-12 Thread Daniel Nogradi
> Is there an easy way to take binary data and build it into a file? Generally > this will be BLOB data drawn from a database, the data will be for jpg > images, I want to take the blob data and build it into a physical .jpg file. > > > > Is there a simple function for doing this in python? Like bi

Re: Lists and Tuples and Much More

2007-04-12 Thread 7stud
> Now I read somewhere that you could change the > list inside that tupple. But I can't find any > documentation that describes HOW to do it. t = (1, 2, ["red", "white"]) t[2][1] = "purple" print t t[2] returns the list, so the second line is equivalent to: lst = t[2] lst[1] = "purple" That is

Re: Lists and Tuples and Much More

2007-04-12 Thread Daniel Nogradi
> And the last example brings up another question. What's the deal with a > tupple that has a list in it such as: > > >>>my_tupple = (1, 2, 3, 4, 5, [6, 7, 8, 9]) > > Now I read somewhere that you could change the list inside that tupple. But > I can't find any documentation that describes HOW to

Re: Lists and Tuples and Much More

2007-04-12 Thread bearophileHUGS
Scott: Others will give you many more answers, here is just a bit. > And how would you sort the list that's in the list? I guess that goes in > conjunction with the section above, but still: >>> my_list = [6, 4, 3, 5, 2, 1] > >>> my_list.append([7, 9, 8, 10]) > >>> my_list.sort() > >>> my_list >

Re: Question About Creating Lists

2007-04-12 Thread Scott
> Please forgo the psychological self analysis from your future posts. Unfortunately I can't, that's how I am, love it or leave it. But if your going to be condescending about it, please leave your future replies in your outbox. Now don't take that as I don't appreciate your reply. I just d

Re: Custom Python Runtime

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 19:02:53 -0300, Jack <[EMAIL PROTECTED]> escribió: > It seems that pywintypes24.dll and pythoncom24.dll have to be in > C:\Windows\System32 directory. Otherwise I get an error. > Any way to get around that? Both are part of the pywin32 extensions, better ask on the python-win

Lists and Tuples and Much More

2007-04-12 Thread Scott
I'm going to start grouping all my questions in one post as this is my second today, and sorta makes me feel dumb to keep having to bother you all with trivial questions. I'll just seperate my questions with:

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread 7stud
On Apr 12, 2:09 pm, Bjoern Schliessmann wrote: > 7stud wrote: > > Where is that list? > > Argh! > > http://www.wxpython.org/maillist.php > > Regards, > > Björn > > -- > BOFH excuse #330: > > quantum decoherence Thanks. It looks like someone asked the same question yesterday. -- http://mail.p

Re: tuples, index method, Python's design

2007-04-12 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2007-04-11, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > In <[EMAIL PROTECTED]>, Antoon Pardon wrote: > > > >> On 2007-04-11, Steven D'Aprano <[EMAIL PROTECTED]> > >> wrote: > >>> Lists are designed for sequ

Re: Custom Python Runtime

2007-04-12 Thread Jack
It seems that pywintypes24.dll and pythoncom24.dll have to be in C:\Windows\System32 directory. Otherwise I get an error. Any way to get around that? >> 3. Some files go to the Windows\system32 directory, including some >> win32all >> files. Can they be in the current directory as python.exe? >

Re: tuples, index method, Python's design

2007-04-12 Thread Alan Isaac
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The main point of immutability is hashability by value (rather than by id). You are treating an effect as a cause. This is the main point *because* of an artifical constraint on tuples. Cheers, Alan Isaac -- http://mai

Re: tuples, index method, Python's design

2007-04-12 Thread Alan Isaac
Chris Mellon said: > Sure. I have never done this. In fact, I have only ever written code > that converted a tuple to a list once, and it was because I wanted > pop(), not index() Well then you apparently made a *mistake*: you chose a tuple when you wanted a mutable object. That is really beside

Re: Need help with the get() method of a Text entry

2007-04-12 Thread Chad
On Apr 12, 5:03 pm, James Stroud <[EMAIL PROTECTED]> wrote: > James Stroud wrote: > > Chad wrote: > > >> I have a simple little program that brings up asks the user to enter a > >> note, then is supposed to place that note into a text file when the > >> user hits the submit button. However, when t

Re: Question About Creating Lists

2007-04-12 Thread 7stud
On Apr 12, 3:29 pm, "Scott" <[EMAIL PROTECTED]> wrote: > I'm sorry if most of my question's seem "petty", but as I've said before, I > need to know the petty just because I need to know. > > This question is more along the lines of just having you guys either agree > or disgree with me, and if disa

Re: tuples, index method, Python's design

2007-04-12 Thread Steven D'Aprano
On Thu, 12 Apr 2007 07:37:38 +, Antoon Pardon wrote: > I once had a problem I like to solve by having a dictionary > where the keys were multidimensional points on an integer grid. > For a number of reasons I thought it would be easier if I could > use lists, but most people argued that would

Re: tuples, index method, Python's design

2007-04-12 Thread Donn Cave
In article <[EMAIL PROTECTED]>, "Alan Isaac" <[EMAIL PROTECTED]> wrote: > As I said: > I doubt that *anyone* who programs in Python > has not encountered the situation where they change > a tuple to a list *solely* for the purpose of getting > access to the index method. This suggests a missing >

Question About Creating Lists

2007-04-12 Thread Scott
I'm sorry if most of my question's seem "petty", but as I've said before, I need to know the petty just because I need to know. This question is more along the lines of just having you guys either agree or disgree with me, and if disagreeing to give the reasoning behind it, to further my unders

Re: SQLite problems

2007-04-12 Thread bayer . justin
> Why fink ?, it is very easy to make sqlite. download the source, > configure, make and install from terminal I did so and now I have the latest sqlite version. But it did not make a difference. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to copy a file on Windows while preserving permissions

2007-04-12 Thread Martin v. Löwis
> Can someone who is more familiar than I with the vagaries of Windows file > protection and the Python interfaces available to it point me in a useful > direction? To copy a file along with its attributes, try SHFileOperation. Alternatively, if you have backup privileges, open the file for bac

Re: Portably generating infinity and NaN

2007-04-12 Thread Martin v. Löwis
Michael Hoffman schrieb: > What's the best way to portably generate binary floating point infinity > and NaNs? I only know two solutions: > > 1. Using the fpconst module proposed in IEEE 754, which I believe shifts > bits around. > > 2. Using an extension module (for example, numarray.ieeespecial

Re: Creating an EXE for XLRD + WIN32COM + wxWidgets application - Help request

2007-04-12 Thread John Machin
On Apr 12, 11:58 pm, Larry Bates <[EMAIL PROTECTED]> wrote: > BrendanC wrote: > > I've started learninhg Python and have developed a small Python app > > that imports Excel data into an Access mdb/jet database. This > > application has dependencies on the following: > > > XLRD -http://cheeseshop.py

Re: Need help with the get() method of a Text entry

2007-04-12 Thread James Stroud
James Stroud wrote: > Chad wrote: > >> I have a simple little program that brings up asks the user to enter a >> note, then is supposed to place that note into a text file when the >> user hits the submit button. However, when the user hits the submit >> button, absolutely nothing happens. IDLE

Re: Need help with the get() method of a Text entry

2007-04-12 Thread James Stroud
Chad wrote: > I have a simple little program that brings up asks the user to enter a > note, then is supposed to place that note into a text file when the > user hits the submit button. However, when the user hits the submit > button, absolutely nothing happens. IDLE doesn't give an error > messa

Re: Need help with the get() method of a Text entry

2007-04-12 Thread James Stroud
Chad wrote: > I have a simple little program that brings up asks the user to enter a > note, then is supposed to place that note into a text file when the > user hits the submit button. However, when the user hits the submit > button, absolutely nothing happens. IDLE doesn't give an error > messa

Re: Inconsistent result from urllib.urlopen

2007-04-12 Thread Facundo Batista
[EMAIL PROTECTED] wrote: > import urllib > f = urllib.urlopen('http://en.wikipedia.org/wiki/Cain') > data = f.read(999) > f.close() > f1 = open('junk.txt', 'w') > f1.write(data) > f1.close() Did you see the file "junk.txt"? It's an error page from Wikipedia, not the actual content page... Re

How to copy a file on Windows while preserving permissions

2007-04-12 Thread Andrew Koenig
The answer to this question probably involves pywin32 or a similar library. I would like to copy a file from one place to another on a Windows machine while preserving as much of the file permissions as it is possible to preserve with whatever my program's privileges happen to be. If the file i

Re: tuples, index method, Python's design

2007-04-12 Thread Robert Kern
Alan Isaac wrote: > I am still puzzled by this discussion. > > As I said: > I doubt that *anyone* who programs in Python > has not encountered the situation where they change > a tuple to a list *solely* for the purpose of getting > access to the index method. This suggests a missing > method, doe

Need help with the get() method of a Text entry

2007-04-12 Thread Chad
I have a simple little program that brings up asks the user to enter a note, then is supposed to place that note into a text file when the user hits the submit button. However, when the user hits the submit button, absolutely nothing happens. IDLE doesn't give an error message and the note is not

Re: tuples, index method, Python's design

2007-04-12 Thread Duncan Booth
"Alan Isaac" <[EMAIL PROTECTED]> wrote: > I doubt that *anyone* who programs in Python > has not encountered the situation where they change > a tuple to a list *solely* for the purpose of getting > access to the index method. This suggests a missing > method, does it not? Who has not done this?

Re: Code Explaination: Spelling correction code

2007-04-12 Thread Drew
On Apr 12, 10:28 am, Steven Bethard <[EMAIL PROTECTED]> wrote: > Drew wrote: > > On Apr 11, 11:27 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > >> Drew wrote: > >>> def known_edits2(word): > >>> return set(e2 for e1 in edits1(word) for e2 in edits1(e1) if e2 in > >>> NWORDS) > > >> This is th

Re: ulimit on open sockets ?

2007-04-12 Thread Maxim Veksler
On 4/10/07, Alex Martelli <[EMAIL PROTECTED]> wrote: > Maxim Veksler <[EMAIL PROTECTED]> wrote: > > > ValueError: filedescriptor out of range in select() > > """ > > > > Should I be using a different version of select or something? Or > > select typically supports 1024 FDs at most (a design limit o

Re: ulimit on open sockets ?

2007-04-12 Thread Maxim Veksler
On 4/10/07, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Maxim Veksler wrote: > > > I've written this code, the general idea was to listen on all > > 65535 port of tcp for connection. > > Please excuse the question: Why would anyone want to do such a manic > thing (instead of, e. g., using raw

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread Bjoern Schliessmann
7stud wrote: > Where is that list? Argh! http://www.wxpython.org/maillist.php Regards, Björn -- BOFH excuse #330: quantum decoherence -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling private base methods

2007-04-12 Thread Duncan Booth
"7stud" <[EMAIL PROTECTED]> wrote: > On Apr 12, 5:04 am, Duncan Booth <[EMAIL PROTECTED]> wrote: >> "7stud" <[EMAIL PROTECTED]> wrote: >> > On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: >> >> Is it possible to call a private base method? I come from a C++ >> >> background, and I li

Re: tuples, index method, Python's design

2007-04-12 Thread Terry Reedy
"Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | I doubt that *anyone* who programs in Python | has not encountered the situation where they change | a tuple to a list *solely* for the purpose of getting | access to the index method. This suggests a missing | method, doe

Re: tuples, index method, Python's design

2007-04-12 Thread Chris Mellon
On 4/12/07, Alan Isaac <[EMAIL PROTECTED]> wrote: > I am still puzzled by this discussion. > > As I said: > I doubt that *anyone* who programs in Python > has not encountered the situation where they change > a tuple to a list *solely* for the purpose of getting > access to the index method. This s

treating str as unicode in legacy code?

2007-04-12 Thread Ben
I'm left with some legacy code using plain old str, and I need to make sure it works with unicode input/output. I have a simple plan to do this: - Run the code with "python -U" so all the string literals become unicode litrals. - Add this statement str = unicode to all .py files so the type

Re: [ANN] mlabwrap-1.0final

2007-04-12 Thread Stef Mientki
Alexander Schmolck wrote: > I'm pleased to finally announce mlabwrap-1.0: > > Project website > --- > > > > Description > --- > > Mlabwrap-1.0 is a high-level python to matlab(tm) bridge that makes calling > matlab functions from python alm

Re: Portably generating infinity and NaN

2007-04-12 Thread Robert Kern
Michael Hoffman wrote: > What's the best way to portably generate binary floating point infinity > and NaNs? I only know two solutions: > > 1. Using the fpconst module proposed in IEEE 754, which I believe shifts > bits around. > > 2. Using an extension module (for example, numarray.ieeespecial

Re: "Cloning" file attributes and permissions

2007-04-12 Thread attn . steven . kuo
On Apr 12, 9:20 am, Paulo da Silva <[EMAIL PROTECTED]> wrote: > Hi! > > I need to process a file to produce another file that *must* have > *exactly* the same attributes and permissions of the former. What is the > best way to do this? The file must not exist with contents (it may exist > empty) un

Re: wrap_EncryptByteArray argument 1 must be string without null bytes, not str

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 15:11:30 -0300, abcd <[EMAIL PROTECTED]> escribió: > Has anyone seen this error before: > > wrap_EncryptByteArray() argument 1 must be string without null bytes, > not str > > I am having a hard time finding anything about it. I have no idea what wrap_EncryptByteArray does, bu

Re: Creating Unique Dictionary Variables from List

2007-04-12 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : > On Wed, 11 Apr 2007 21:03:20 +0200, Bruno Desthuilliers wrote: > > >>Greg Corradini a écrit : >> >>>Hello All, >>>I'm attempting to create multiple dictionaries at once, each with unique >>>variable names. The number of dictionaries i need to create depends on the >>>l

Several images onto one 2D-plot in matplotlib?

2007-04-12 Thread karsten . borgwardt
Hi! I have got the following problem: I want to plot a 2D-function in matplotlib, and then I want to insert (small) png-Images at certain locations within the plot. Any suggestions how to do that? Thanks a lot! yggobk -- http://mail.python.org/mailman/listinfo/python-list

Re: Portably generating infinity and NaN

2007-04-12 Thread Michael Hoffman
Michael Hoffman wrote: > 2. Using an extension module (for example, numarray.ieeespecial will do > it). I guess I could always use ctypes as well, and say, get -inf from libc.log(ctypes.c_double(0.0)). Although we're venturing away from portable territory then, since specifying how to load lib

Re: Inconsistent result from urllib.urlopen

2007-04-12 Thread Gabriel Genellina
En Thu, 12 Apr 2007 15:25:03 -0300, <[EMAIL PROTECTED]> escribió: > Any ideas why I don't get the same result from the python script as I > do from a web browser? This problem seems to be a recent > development. The scripts I wrote like this worked fine for a while > and then stopped working wit

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread 7stud
On Apr 12, 9:43 am, [EMAIL PROTECTED] wrote: > On Apr 12, 8:37 am, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > 7stud wrote: > > > I'm trying to allow for a horizontal scrollbar on a textarea, but > > > the scrollbar won't appear when I enter a long string of text(by > > > leaning on on

Portably generating infinity and NaN

2007-04-12 Thread Michael Hoffman
What's the best way to portably generate binary floating point infinity and NaNs? I only know two solutions: 1. Using the fpconst module proposed in IEEE 754, which I believe shifts bits around. 2. Using an extension module (for example, numarray.ieeespecial will do it). I thought of using flo

Re: wxPython, mac, wx.HSCROLL not working

2007-04-12 Thread 7stud
On Apr 12, 9:43 am, [EMAIL PROTECTED] wrote: > On Apr 12, 8:37 am, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > 7stud wrote: > > > I'm trying to allow for a horizontal scrollbar on a textarea, but > > > the scrollbar won't appear when I enter a long string of text(by > > > leaning on on

Re: Calling private base methods

2007-04-12 Thread 7stud
On Apr 12, 5:04 am, Duncan Booth <[EMAIL PROTECTED]> wrote: > "7stud" <[EMAIL PROTECTED]> wrote: > > On Apr 12, 2:47 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote: > >> Is it possible to call a private base method? I come from a C++ > >> background, and I liked this construction as my base class has

Re: odd unicode error

2007-04-12 Thread tubby
Martin v. Löwis wrote: >> path += '/' + b >> UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: >> ordinal not in range(128) >> >> Any ideas? > > path is a Unicode string, b is a byte string and contains the > byte \xd0. > > The problem is that you have a directory with f

Re: Inconsistent result from urllib.urlopen

2007-04-12 Thread Laszlo Nagy
> Any ideas why I don't get the same result from the python script as I > do from a web browser? This problem seems to be a recent > development. The scripts I wrote like this worked fine for a while > and then stopped working within the past couple of weeks. > Maybe it has to do something wi

Re: odd unicode error

2007-04-12 Thread Martin v. Löwis
> path += '/' + b > UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 1: > ordinal not in range(128) > > Any ideas? path is a Unicode string, b is a byte string and contains the byte \xd0. The problem is that you have a directory with file names in it that cannot be conver

Re: Newbie help with array handling

2007-04-12 Thread Shane Geiger
""" Since you are a beginner and since RCCILA (Runnable, Commented Code Is Least Ambiguous) I'm proving this example code to help you get used to manipulating data with python. This should give you an idea of how to juggle a bit. After you learn how to do this you likely still will not be

Inconsistent result from urllib.urlopen

2007-04-12 Thread junkdump2861
Here's the problem: using Netscape 7.1, I type use the view page source command (url is http://en.wikipedia.org/wiki/Cain) and save the raw HTML file and it's 67 kb, and has the addresses of all the images in it. I want the exact same thing from my Python script, but I'm not getting it. Instead

Re: tuples, index method, Python's design

2007-04-12 Thread Alan Isaac
I am still puzzled by this discussion. As I said: I doubt that *anyone* who programs in Python has not encountered the situation where they change a tuple to a list *solely* for the purpose of getting access to the index method. This suggests a missing method, does it not? Who has not done this?

VB6 To Python

2007-04-12 Thread Sampson, David
Hey Folks, I'm working towards understanding python and one of my hopes is to convert an internal program from VB6 to python. Partialy to learn python more, and partialy because VB6 is a dead language and partialy because I am trying to encourage the use of open source solutions. I am wondering i

wrap_EncryptByteArray argument 1 must be string without null bytes, not str

2007-04-12 Thread abcd
Has anyone seen this error before: wrap_EncryptByteArray() argument 1 must be string without null bytes, not str I am having a hard time finding anything about it. -- http://mail.python.org/mailman/listinfo/python-list

Can anybody give me an example about how to write the image drawn by the canvas in WxPython into postscript file

2007-04-12 Thread Hank Gong
Hi, all I programmed by python to draw some simple images on the canvas in wxPython. I found there is a PostScriptDC in wxPython. However, I can not find an example about how to use it. Can anyone give me a simple example to show how to do it? -- http://mail.python.org/mailman/listinfo/python-li

  1   2   3   >