Re: nesting for statements?

2005-11-29 Thread Peter Otten
[EMAIL PROTECTED] wrote: > Hi. Thanks for the tip. However, implementing that example, the script > will only generate the second output "file", (or it's overwriting the > first one), so all I get when run is "fileb". I think your looping code has the structure for x in ["a", "b", "c"]: pass

RE: Multiple versions

2005-11-29 Thread Tim Golden
(Just to keep things readable, I've reordered the posts top-to-bottom chronologically. And "Me" is the cognomen of the original poster, not simply a redundant personal pronoun!) [Me] > I need to install both 2.3 and 2.4 on my Win2000 system. > Can someone please > give me a pointer as to how to d

Re: exception KeyboardInterrupt and os.system command

2005-11-29 Thread malv
Indeed, I did the experiment again with while 1: y = os.system("sleep 1") print y and it ALWAYS returns 0, with control-c or without. >From past experience, I am pretty sure that in other cases I have been getting non-zero return values. So I would hesitate to believe that what you observe i

Re: Call OCX from python?

2005-11-29 Thread Claudio Grondi
"JustSomeGuy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > > "Claudio Grondi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > "JustSomeGuy" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > > news:[EMAIL PROTECTED] > > > Hi I have a commercial OCX that I want to

Re: General question about Python design goals

2005-11-29 Thread Antoon Pardon
On 2005-11-28, Duncan Booth <[EMAIL PROTECTED]> wrote: > Antoon Pardon wrote: > >> >> No I gave an example, you would implement differently. But even >> if you think my example is bad, that would make it a bad argument >> for tuples having list methods. That is not the same as being >> a good argu

Re: (newbie) N-uples from list of lists

2005-11-29 Thread vd12005
great thanks to all. actually i have not seen it was a cross product... :) but then there are already few others ideas from the web, i paste what i have found below... BTW i was unable to choose the best one, speaking about performance which one should be prefered ? ### -

unicode speed

2005-11-29 Thread David Siroky
Hi! I need to enlighten myself in Python unicode speed and implementation. My platform is AMD [EMAIL PROTECTED] (x86-32), Debian, Python 2.4. First a simple example (and time results): x = "a"*5000 real0m0.195s user0m0.144s sys 0m0.046s x = u"a"*5000 real0m2.477s user

Re: New Ordered Dictionery to Criticise

2005-11-29 Thread Fuzzyman
Martin v. Löwis wrote: > Fuzzyman wrote: > > Criticism solicited (honestly) :-) > > A couple of minor points: > - I would drop 2.2 compatibility There are a lot of cheap hosting accounts where Python 2.2 is all that is available. I would only drop support if there is some *compelling* reason to d

Virus in your Mail to empire.support

2005-11-29 Thread root
The VirusCheck at the IMST generated the following Message: V I R U S A L E R T Our VirusCheck found a Virus (W32/Netsky-Q) in your eMail to "empire.support". This eMail has been deleted ! Now it is on you to check your System for Viruses This Syst

Re: New Ordered Dictionery to Criticise

2005-11-29 Thread Fuzzyman
Christoph Zwerschke wrote: > Fuzzyman wrote: > > Sorry for this hurried message - I've done a new implementation of out > > ordered dict. This comes out of the discussion on this newsgroup (see > > blog entry for link to archive of discussion). > > Thanks. I'll try to check it out and put my oar i

Re: XMLSchema Parsing

2005-11-29 Thread Dennis Benzinger
km schrieb: > Hi all, > i'd like to know if there are any good XMLSchema (.xsd files) parsing modules > in python. > regards, > KM > Try lxml a pythonic binding for the libxml2 and libxslt libraries. Bye, Dennis -- http://mail.python.org/mailman/listinfo/python-

Re: XMLSchema Parsing

2005-11-29 Thread Tim N. van der Leeuw
Hi, Depends entirely on what you want. I've written some XSD tools in Python that do exactly what I want -- but don't offer support for any XSD features that I didn't happen to need. Module I wrote supports include/import and redefine; parses sequences, complexTypes and simpleTypes, but not much m

Re: General question about Python design goals

2005-11-29 Thread Christoph Zwerschke
Mike Meyer wrote: > Christoph Zwerschke wrote: >>A programming language is not a "work of art". If you are an artist, >>you may break symmetry and introduce all kinds of unexpected >>effects. Actually, as an artist, you purposfully want to provoke >>astonishment. But if I am using a programming lan

Re: unicode speed

2005-11-29 Thread Neil Hodgson
David Siroky: > output = '' I suspect you really want "output = u''" here. > for c in line: > if not unicodedata.combining(c): > output += c This is creating as many as 5 new string objects of increasing size. To build large strings, some common faster t

Re: Python as Guido Intended

2005-11-29 Thread Antoon Pardon
On 2005-11-28, Mike Meyer <[EMAIL PROTECTED]> wrote: > Antoon Pardon <[EMAIL PROTECTED]> writes: >> Op 2005-11-25, Mike Meyer schreef <[EMAIL PROTECTED]>: >>> Antoon Pardon <[EMAIL PROTECTED]> writes: Well this is, is one thing I have a problem with. The python people seem to be more conc

Re: Death to tuples!

2005-11-29 Thread Bengt Richter
On 27 Nov 2005 23:33:27 -0800, "Dan Bishop" <[EMAIL PROTECTED]> wrote: >Mike Meyer wrote: >> It seems that the distinction between tuples and lists has slowly been >> fading away. What we call "tuple unpacking" works fine with lists on >> either side of the assignment, and iterators on the values

Re: Death to tuples!

2005-11-29 Thread Duncan Booth
Antoon Pardon wrote: > The question is, should we consider this a problem. Personnaly, I > see this as not very different from functions with a list as a default > argument. In that case we often have a list used as a constant too. > > Yet python doesn't has a problem with mutating this list so

[no subject]

2005-11-29 Thread Hortles
hello, I have just downloaded the mac os x version of python and when i open the PythonIDE it just quits straight away. Is there something I'm am doing wrong. Thanks, Allan -- http://mail.python.org/mailman/listinfo/python-list

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
Robert Kern <[EMAIL PROTECTED]> writes: > It's a draft, but it contains useful information. Also, Larry Rosen's > book _Open Source Licensing_ is quite helpful (and free!). > > http://rosenlaw.com/oslbook.htm That is the guy who claims it is impossible to release anything into the public domain

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
"mojosam" <[EMAIL PROTECTED]> writes: > I will be doing the bulk of the coding on my own time, because I need > to be able to take these tools with me when I change employers. > However, I'm sure that in the course of using these tools, I will need > to spend time on the job debugging or tweaking t

Re: After migrating from debian to ubuntu, tkinter "hello world" doesn't work

2005-11-29 Thread Mandus
28 Nov 2005 11:02:57 -0800 skrev [EMAIL PROTECTED]: > Hi > > My tkinter apps worked fine in debian linux (woody and sarge) > I moved to ubuntu 5.10 > > I follow the 'hello world' test as seen in > http://wiki.python.org/moin/TkInter > > > import _tkinter # with underscore, and lowercase 't' > impor

Re: Why I need to declare import as global in function

2005-11-29 Thread didier . doussaud
the error message : EXCEPTION RAISED:: Traceback (most recent call last): File "../tu.py", line 21, in run_tu execfile( filename ) File "TU_05_010.py", line 8, in ? import TU_05_tools File "./TU_05_tools.py", line 4, in ? f() File "./TU_

Re: Why I need to declare import as global in function

2005-11-29 Thread Duncan Booth
wrote: > I have remarq that this problem is raised when I execute code in an > imported module (during importation) > > I think I will be able to isolate it and have a simple sample soon > Meanwhile, try adding: import math to the top of TU_05_tools.py. -- http://mail.python.org/mail

Re: General question about Python design goals

2005-11-29 Thread Steve Holden
Christoph Zwerschke wrote: > Fredrik Lundh schrieb: [...] >>I suggest you look up the phrase "bike shed effect". next, go read some >>recent PEP:s to see what's really going on in the Python design universe. > > > The bike shed effect is a good explanation and so true. About 8 years > ago when

Re: Why I need to declare import as global in function

2005-11-29 Thread Peter Otten
[EMAIL PROTECTED] wrote: > the error message : > > EXCEPTION RAISED:: > > Traceback (most recent call last): >File "../tu.py", line 21, in run_tu > execfile( filename ) >File "TU_05_010.py", line 8, in ? > import TU_05_tools >File "./TU_05_tools.py"

ANNOUNCE: twill v0.8

2005-11-29 Thread C. Titus Brown
ANNOUNCING twill v0.8. twill is a simple language for testing Web applications. It's designed for automated testing of Web sites, but it can be used to interact with Web sites in a variety of ways. twill has an interactive shell, 'twill-sh', and can also run scripts. twill is a reimplementation

run runs away

2005-11-29 Thread Nx
Hello I think my question is how to make the script wait until it returns from a call to run() Here is a code snippet: # next lines calls python2.4 32 bit version # from a script running in python2.3 64 bit version run("python2.4", "dbviewmaster.py") # I want the following only to run after

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-11-29 Thread Colin J. Williams
[EMAIL PROTECTED] wrote: > Dear all, > > This is just to let you know that the lastest version Dao language is > released. > This Dao was previously called Tao, and now is changed to Dao to avoid > confusion > with another Tao langauge. There are a number of new features > implemented in > this ve

Re: Death to tuples!

2005-11-29 Thread Fredrik Lundh
Paddy wrote: > I would consider > t = ([1,2], [3,4]) > to be assigning a tuple with two list elements to t. > The inner lists will be mutable but I did not know you could change the > outer tuple and still have the same tuple object. you can't. but since hash(tuple) is defined in terms of map(

Re: Death to tuples!

2005-11-29 Thread [EMAIL PROTECTED]
Having a general frozen() system makes a lot of sense. People use tuples for two different things: as a lightweight record type (e.g., (x, y) coordinate pairs), and as an immutable list. The latter is not officially sanctioned but is widely believed to be the purpose for tuples. And the value of

Re: Death to tuples!

2005-11-29 Thread Bengt Richter
On 28 Nov 2005 14:48:35 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >Antoon Pardon wrote: > >>> >>> def func(x): >>> ... if x in [1,3,5,7,8]: >>> ... print 'x is really odd' >>> ... >>> >>> dis.dis(func) >>> ... >>>3 20 LOAD_FAST0 (x) >>> 23 LOAD_

Re: Looking for small, impressive 3D-related Python script

2005-11-29 Thread Michael Schneider
Ken, I would suggest that you embed python in your app (very easy to do). -And convert several of your existing scripts to python. -Show them a stack of python books for customer training purposes - Drive excel with python (allows integration of your product with other products. - Pick an are

Re: Why I need to declare import as global in function

2005-11-29 Thread Duncan Booth
Peter Otten wrote: >> Traceback (most recent call last): >>File "../tu.py", line 21, in run_tu >> execfile( filename ) >>File "TU_05_010.py", line 8, in ? >> import TU_05_tools >>File "./TU_05_tools.py", line 4, in ? >> f() >>File "./

Re: Stealing focus: PIL

2005-11-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > I'm using the Python Image Library (PIL) for Python 2.4. > > If I have an image and I show it > from PIL import Image > im = Image.new('RGB',100,100) > im.show() > then the output window steals focus. It's very handy to use > an image to show the progress of execut

Re: Precision for equality of two floats?

2005-11-29 Thread Bengt Richter
On Mon, 28 Nov 2005 07:58:37 -0800, [EMAIL PROTECTED] (Alex Martelli) wrote: >Anton81 <[EMAIL PROTECTED]> wrote: > >> Hi! >> >> When I do simple calculation with float values, they are rarely exactly >> equal even if they should be. What is the threshold and how can I change >> it? > >Python's bu

TypeError: unsubscriptable object

2005-11-29 Thread enas khalil
when i run this script to make a training of some text and so can use condfreqdistributions to guess text in test , my code isas follows: from nltk.probability import ConditionalFreqDistfrom nltk.tokenizer import WhitespaceTokenizerfrom nltk.tagger import *token1 = []train_tokens = []cfdist=Co

Re: General question about Python design goals

2005-11-29 Thread Bengt Richter
On Tue, 29 Nov 2005 00:52:25 -0500, Mike Meyer <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Bengt Richter) writes: >>>Then feel free to submit patches for the docs. >> This is easy to say, and maybe the docs maintainers are accomodating, >> but I'd be the average reader wouldn't have a concept o

Re: Why I need to declare import as global in function

2005-11-29 Thread Peter Otten
Duncan Booth wrote: > Isn't it fun trying to guess the problem in the absence of the code? What other reason could there be to forego the sane approach -- stick 'import math' everywhere it might belong? Those exec/execfile() peculiarities are so much more interesting ;-) Peter -- http://mail.

Re: How to write an API for a Python application?

2005-11-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: . . . >Yeah, O'Reilly tools have this delightful penchant for inserting a space >between two adjacent underscores, drives me crazy:-(. > > >Alex Do more

Re: Why I need to declare import as global in function

2005-11-29 Thread Fredrik Lundh
Duncan Booth wrote: > That is unlikely to help. The execfile target seems to have been > TU_05_010.py, but the file which cannot access math is TU_05_tools.py > accessed by a normal import, so adding some globals to the execfile call > won't really do anything useful. > > Isn't it fun trying to gu

Re: Why I need to declare import as global in function

2005-11-29 Thread didier . doussaud
You're right, the problem is around the usage of "execfile". But I have still difficulties to get a simple sample and have no enough time to work on it until end of week. I will post if I resolve my problem or if I can get a simple sample. -- http://mail.python.org/mailman/listinfo/python-

Re: Book: Cross-Platform GUI Programming with wxWidgets?

2005-11-29 Thread kdahlhaus
Thanks. Did not know about that book. -- http://mail.python.org/mailman/listinfo/python-list

Re: Death to tuples!

2005-11-29 Thread jepler
On Tue, Nov 29, 2005 at 10:41:13AM +, Bengt Richter wrote: > Seems like str.__mod__ could take an arbitary (BTW, matching length, > necessarily? > Or just long enough?) iterable in place of a tuple, just like it can take > an arbitrary mapping object in place of a dict for e.g. '%(name)s'% >

Re: run runs away

2005-11-29 Thread jepler
"run" is not the name of a Python built-in function. That leaves everyone but you somewhat in the dark about why it does or does not wait for the created process to complete. If you want a function that starts a new process and waits for it to complete, you probably want to use os.spawnv(os.P_WAI

xpath support in python 2.4

2005-11-29 Thread And80
Hi, I would like to use xpath modules in python2.4 In my local machine I am running python2.3.5 and on the server I run python2.4. I have seen that while on my computer i am able to import xml.xpath, on the server the module seems to not exist. Is it still part of the standard library? if not,

sax.make_parser() segfaults

2005-11-29 Thread Frank Millman
Hi all I am using Python 2.4.1. I have machines running FC4, RH9, and MSW Server 2003 for testing. If I call sax.make_parser() from the interpreter or from a stand-alone program, it works fine on all machines, but in the following setup it works correctly on MSW, but segfaults on both FC4 and RH9

Re: Precision for equality of two floats?

2005-11-29 Thread gene tani
Anton81 wrote: > Hi! > > When I do simple calculation with float values, they are rarely exactly > equal even if they should be. What is the threshold and how can I change > it? > > e.g. "if f1==f2:" will always mean "if abs(f1-f2)<1e-6:" > > Anton googled for "floating point" "comparison toleran

Re: TypeError: unsubscriptable object

2005-11-29 Thread Fredrik Lundh
"enas khalil" <[EMAIL PROTECTED]> wrote: > i got this error : > Traceback (most recent call last): > File "F:\MSC first Chapters\28-11\firstprog1.py", line 53, in -toplevel- > for cond in word :cfdist[cond].inc[aa['TAG']] > TypeError: unsubscriptable object it means that either cfdist,

Re: run runs away

2005-11-29 Thread Fredrik Lundh
"Nx" wrote: > Here is a code snippet: > > # next lines calls python2.4 32 bit version > # from a script running in python2.3 64 bit version > run("python2.4", "dbviewmaster.py") > # I want the following only to run after > # running of python2.4 has finished > self.textBrowser1.reload > f = open(s

Re: Death to tuples!

2005-11-29 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Having a general frozen() system makes a lot of sense. People use > tuples for two different things: as a lightweight record type (e.g., > (x, y) coordinate pairs), and as an immutable list. The latter is not > officially sanctioned but is widely believed to be the pur

Re: BisonGen parser generator. Newbie question

2005-11-29 Thread uche . ogbuji
""" I'm trying to run the calculator example included with the "BisonGen" parser generator, but I've been unable to put it to work. When I compile the xml file "simple.bgen" with the script "BisonGen.bat", the only parser I get is a C file. I've heard BisonGen generates also a python file, which i

Re: Move xml.sax.saxutils.*?

2005-11-29 Thread uche . ogbuji
""" It seems like functions such as xml.sax.saxutils.escape and unescape are generally useful, and not at all tied to the xml.sax module. Would it make sense to move them somewhere else, like to xml? """ It would be useful to allow from xml import escape, unescape But as an alias, rather than a

Re: General question about Python design goals

2005-11-29 Thread Sibylle Koczian
Peter Hansen schrieb: > Christoph Zwerschke wrote: > >> Ok, these are nice aphorisms with some truth. But I had to think of >> the German excuse "Wer Ordnung hält ist nur zu Faul zum Suchen - ein >> Genie überblickt das Chaos." ("Those who try to keep things tidy are >> just too lazy to search

Problem cmpiling M2Crypto

2005-11-29 Thread Thomas G. Apostolou
Hello all. i am trying to make some win32 binaries of M2Crypto 0.15 What I use is: Python 2.3.3 openssl-0.9.7i swigwin 1.3.27 I have build the openssl binaries and have installed the Swig binary python dir is C:\Program Files\Plone 2\Python openssl dir is c:\openssl Swig dir is c:\swig so I ha

Re: Death to tuples!

2005-11-29 Thread Duncan Booth
Dan Bishop wrote: >> Is there any place in the language that still requires tuples instead >> of sequences, except for use as dictionary keys? > > The % operator for strings. And in argument lists. > > def __setitem__(self, (row, column), value): >... > Don't forget the exception specifica

Re: General question about Python design goals

2005-11-29 Thread Fredrik Lundh
Steve Holden wrote: > > The bike shed effect is a good explanation and so true. About 8 years > > ago when I started to work at my current working place at the university > > I suggested that a bike shed should be provided for people like me. > > Since then, a lot of million euro projects have bee

Unifying Attributes and Names (was: Re: Death to tuples!)

2005-11-29 Thread Christopher Subich
Bengt Richter wrote: > If we had a way to effect an override of a specific instance's attribute > accesses > to make certain attribute names act as if they were defined in > type(instance), and > if we could do this with function instances, and if function local accesses > would > check if name

Re: General question about Python design goals

2005-11-29 Thread Bengt Richter
On 29 Nov 2005 08:27:43 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote: >On 2005-11-28, Duncan Booth <[EMAIL PROTECTED]> wrote: >> Antoon Pardon wrote: >> >>> >>> No I gave an example, you would implement differently. But even >>> if you think my example is bad, that would make it a bad argument >>

Re: How to get started in GUI Programming?

2005-11-29 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Kay Schluehr <[EMAIL PROTECTED]> wrote: > >[EMAIL PROTECTED] wrote: >> I am trying to learn GUI programming in Python, but have to confess I >> am finding it difficult. > >Don't do it if you can prevent it. > >GUI - toolkits are very complex beasts and at least to me

Re: Death to tuples!

2005-11-29 Thread skip
>> Actually, no, I hadn't. I don't use tuples that way. It's rare when >> I have a tuple whose elements are not all floats, strings or ints, >> and I never put mutable containers in them. Alex> You never have a dict whose values are lists? Sorry, incomplete explanation. I ne

wxPython : getting started

2005-11-29 Thread David Sulc
Hi ! I've looked all over (internet, books, etc.) and I haven't found a very good ressource to get started with wxPython (yes, I've been through their tutorial). What I would basically like to do for starters is to be able to define the main panel being displayed. For example : 1. wxFrame cont

Re: xpath support in python 2.4

2005-11-29 Thread Fredrik Lundh
"And80" wrote: > I would like to use xpath modules in python2.4 In my local machine > I am running python2.3.5 and on the server I run python2.4. I have seen > that while on my computer i am able to import xml.xpath, on the server > the module seems to not exist. Is it still part of the standa

Re: Writing pins to the RS232

2005-11-29 Thread Nick Craig-Wood
Richard Brodie <[EMAIL PROTECTED]> wrote: > If you just need one or two signals, then it might be practical to use one > of the control lines, and PySerial supports this (UPS monitoring software > often works this way). I've done this many times (not with PySerial) for misc sensors. With PySer

MySQLdb-python how to install on MacOsX

2005-11-29 Thread Steve
Darwin steve.local 8.3.0 Darwin Kernel Version 8.3.0: Mon Oct 3 20:04:04 PDT 2005; root:xnu-792.6.22.obj~2/RELEASE_PPC Power Macintosh powerpc MacOSX 10.4.3 mysql Ver 14.7 Distrib 4.1.14, for apple-darwin8.2.0 (powerpc) using readline 4.3 runing the software gives me steve:~/MySQL-python-1.2.

Re: xpath support in python 2.4

2005-11-29 Thread gene tani
And80 wrote: > Hi, > I would like to use xpath modules in python2.4 In my local machine > I am running python2.3.5 and on the server I run python2.4. I have seen > that while on my computer i am able to import xml.xpath, on the server > the module seems to not exist. Is it still part of the st

newbie question concerning formatted output

2005-11-29 Thread Thomas Liesner
Hello all, i am having some hard time to format the output of my small script. I am opening a file which containes just a very long string of hexdata seperated by spaces. Using split() i can split this string into single words and print them on stdout. So far so good. But i want to print always th

Re: Python as Guido Intended

2005-11-29 Thread Mike Meyer
Antoon Pardon <[EMAIL PROTECTED]> writes: >> You see, you can make languages more powerful by *removing* things >> from it. > You cast this in way to general terms. The logic conclusion > from this statements is that the most powerfull language > is the empty language. The only way you reach that

Re: Which License Should I Use?

2005-11-29 Thread Andrew Koenig
"Robert Kern" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrew Koenig wrote: >> I'm pretty sure that there was a change to the copyright laws a few years >> ago (perhaps as part of the DMCA), that made it clear that you own >> everything you produce, unless you're a W-2 employ

Re: Which License Should I Use?

2005-11-29 Thread Andrew Koenig
"Mike Meyer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Definitely not. The most recent change to the copyright laws made > works of music recorded to fullfill a contract "work for hire" by > default. If there's a contract -- i.e., a written agreement, then why does it matter?

Re: xpath support in python 2.4

2005-11-29 Thread Alan Kennedy
[And80] > I would like to use xpath modules in python2.4 In my local machine > I am running python2.3.5 and on the server I run python2.4. I have seen > that while on my computer i am able to import xml.xpath, on the server > the module seems to not exist. > Is it still part of the standard l

Re: newbie question concerning formatted output

2005-11-29 Thread Dennis Benzinger
Thomas Liesner schrieb: > [...] > i am having some hard time to format the output of my small script. I am > opening a file which containes just a very long string of hexdata > seperated by spaces. Using split() i can split this string into single > words and print them on stdout. So far so good. B

ncurses' Dark Devilry

2005-11-29 Thread Jeremy Moles
I'm working on a project using ncurses w/ Python. As an aside, I implemented addchstr in the cursesmodule.c file in Python SVN, if anyone wants me to try and get that made permanent. AT ANY RATE... I was wondering--and this is more a general curses question rather than a Python one, but I know th

Re: Death to tuples!

2005-11-29 Thread Bengt Richter
On Tue, 29 Nov 2005 09:26:53 -0600, [EMAIL PROTECTED] wrote: > >--cvVnyQ+4j833TQvp >Content-Type: text/plain; charset=us-ascii >Content-Disposition: inline > >On Tue, Nov 29, 2005 at 10:41:13AM +, Bengt Richter wrote: >> Seems like str.__mod__ could take an arbitary (BTW, matching length, >>

Re: newbie question concerning formatted output

2005-11-29 Thread Dave Hansen
On Tue, 29 Nov 2005 17:40:08 GMT in comp.lang.python, Thomas Liesner <[EMAIL PROTECTED]> wrote: [...]> >So instead of: > >3905 >3009 > [...] > >i'd like to have: > >3905 3009 [...] > >This is the codesnippet i am using: > >#!/usr/bin/python > >import string >inp = open("xyplan.nobreaks","r

Web functions idea

2005-11-29 Thread Mark Carter
I was musing recently about how one could, for example, set up a really simple mailing subscription list. It occurred to me that a really simple way to implement it would be to use xmlrpc. So there could be a function subscribe(emailAddress), which would send an email for confirmation, and anothe

Re: newbie question concerning formatted output

2005-11-29 Thread [EMAIL PROTECTED]
You can try something like: #!/usr/bin/python import sys inp = open("xyplan.nobreaks") data = [ i.strip() for i in inp if i ] while data: print ' '.join(data[0:3]) del data[0:3] -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question concerning formatted output

2005-11-29 Thread Fredrik Lundh
Thomas Liesner wrote: > i am having some hard time to format the output of my small script. I am > opening a file which containes just a very long string of hexdata > seperated by spaces. Using split() i can split this string into single > words and print them on stdout. So far so good. But i want

Re: Why are there no ordered dictionaries?

2005-11-29 Thread Bengt Richter
On Sun, 27 Nov 2005 12:00:23 +0100, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: > >>>d.keys[:] = newkeyseq >> >> Do you really mean just re-ordering the keys without a corresponding >> reording of values?? >> That would be a weird renaming of all values. Or do you means

wxGrid and Focus Event

2005-11-29 Thread lux
Hi, How can I capture the EVT_SET_FOCUS on a wxGrid? Tank's in advance Luca -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie question concerning formatted output

2005-11-29 Thread Micah Elliott
On Nov 29, Fredrik Lundh wrote: > inp = open("xyplan.nobreaks","r") > data = inp.read() > > import textwrap > for line in textwrap.wrap(data, 15): > print line Right -- if the data is that regular then every 15th item is the split-point. A variation on this theme then is: for i in range

Re: wxGrid and Focus Event

2005-11-29 Thread Paul McNett
lux wrote: > How can I capture the EVT_SET_FOCUS on a wxGrid? If you want to catch when the grid as a whole gets the focus, use: >>> grid.Bind(wx.grid.EVT_SET_FOCUS, self.onGridFocus) If you want to catch when a cell in the grid gets the focus, use: >>> grid.Bind(wx.grid.EVT_GRID_SELECT_CELL

Re: wxGrid and Focus Event

2005-11-29 Thread Paul McNett
Paul McNett wrote: > lux wrote: > >>How can I capture the EVT_SET_FOCUS on a wxGrid? > > > If you want to catch when the grid as a whole gets the focus, use: > > >>> grid.Bind(wx.grid.EVT_SET_FOCUS, self.onGridFocus) Oops, my bad: >>> grid.Bind(wx.EVT_SET_FOCUS, self.onGridFocus) > If you

Re: Which License Should I Use?

2005-11-29 Thread Paul Rubin
"Andrew Koenig" <[EMAIL PROTECTED]> writes: > > Definitely not. The most recent change to the copyright laws made > > works of music recorded to fullfill a contract "work for hire" by > > default. > > If there's a contract -- i.e., a written agreement, then why does it matter? Music recordings of

Re: Web functions idea

2005-11-29 Thread bruno at modulix
Mark Carter wrote: > I was musing recently about how one could, for example, set up a really > simple mailing subscription list. It occurred to me that a really simple > way to implement it would be to use xmlrpc. > So there could be a function > subscribe(emailAddress), > which would send an email

Re: wxPython : getting started

2005-11-29 Thread Colin J. Williams
David Sulc wrote: > Hi ! > > I've looked all over (internet, books, etc.) and I haven't found a very > good ressource to get started with wxPython (yes, I've been through > their tutorial). > > What I would basically like to do for starters is to be able to define > the main panel being displa

Compiling Guppy-PE extension modules

2005-11-29 Thread Sverker Nilsson
I have been informed that Guppy-PE (http://guppy-pe.sourceforge.net) has failed to compile its extension modules with a Microsoft .NET 2003 compiler under Windows 2000. [To the person who informed me about this in an email per 27 Nov: Thanks for your message. I couldn't reply to you becaus

Re: wxGrid and Focus Event

2005-11-29 Thread lux
Can you try this code? If you press only the TAB key the focus go from the TextCtrl to the Grid (I suppose) but onGridFocus in not called. any idea? Luca. ## import wx import wx.grid app = wx.PySimpleApp() f = wx.Frame(None, -1, "") p = wx.Panel(f, -1) s = wx.BoxSizer(wx.VERT

Re: newbie question concerning formatted output

2005-11-29 Thread Patrick Down
>>> a = [str(i) for i in range(0,17)] >>> for i in range(0,len(a),3): ... print " ".join(a[i:i+3]) ... 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 -- http://mail.python.org/mailman/listinfo/python-list

Re: Web functions idea

2005-11-29 Thread Mark Carter
bruno at modulix wrote: > Mark Carter wrote: > Congratulations, you've just rediscovered REST !-) Huzzah! > Turbogears is probably what you're looking for (if not quite what you > describe). Thanks. It looks quite interesting. -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling Guppy-PE extension modules

2005-11-29 Thread Claudio Grondi
"Sverker Nilsson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > I have been informed that Guppy-PE (http://guppy-pe.sourceforge.net) > has failed to compile its extension modules with a Microsoft .NET 2003 > compiler under Windows 2000. > > [To the person who informed me abou

Re: CGI question

2005-11-29 Thread Dan Stromberg
On Sat, 26 Nov 2005 13:26:11 +0100, Fredrik Lundh wrote: > Dan Stromberg wrote: > >> What's the best way of converting this: >> >> 'hide\\?http://www.dedasys.com/articles/programming_language_economics.html\x012005-07-20 >> 14:48' >> >> ...to something easily usable in a python CGI script? > > e

Re: wxGrid and Focus Event

2005-11-29 Thread Paul McNett
lux wrote: > Can you try this code? Sure, thanks for posting it! > If you press only the TAB key > the focus go from the TextCtrl to the Grid (I suppose) > but onGridFocus in not called. Confirmed, at least on Gtk. > any idea? Yep, the grid is actually a collection of subwindows, and I made

Re: newbie question concerning formatted output

2005-11-29 Thread dwelch
Thomas Liesner wrote: > Hello all, > > i am having some hard time to format the output of my small script. I am > opening a file which containes just a very long string of hexdata > seperated by spaces. Using split() i can split this string into single > words and print them on stdout. So far so g

Re: XMLSchema Parsing

2005-11-29 Thread uche . ogbuji
km wrote: > i'd like to know if there are any good XMLSchema (.xsd files) parsing modules > in python. > regards, Parse and do what? You can parse WXS (a.k.a. XSD) with any XML parser out there. Anyway, off-head, Python tools that handle WXS, to some extent: xsv libxml2/Python lxml generateDS.

Re: ncurses' Dark Devilry

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, Jeremy Moles <[EMAIL PROTECTED]> wrote: > I'm working on a project using ncurses w/ Python. As an aside, I > implemented addchstr in the cursesmodule.c file in Python SVN, if anyone > wants me to try and get that made permanent. > > AT ANY RATE... > > I was wonde

Re: unicode speed

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Siroky <[EMAIL PROTECTED]> wrote: > Hi! > > I need to enlighten myself in Python unicode speed and implementation. > > My platform is AMD [EMAIL PROTECTED] (x86-32), Debian, Python 2.4. > > First a simple example (and time results): > > x = "a"*5000 >

Re: wxPython : getting started

2005-11-29 Thread Tony Nelson
In article <[EMAIL PROTECTED]>, David Sulc <[EMAIL PROTECTED]> wrote: > Hi ! > > I've looked all over (internet, books, etc.) and I haven't found a very > good ressource to get started with wxPython (yes, I've been through > their tutorial). > > What I would basically like to do for starters

Re: Which License Should I Use?

2005-11-29 Thread Robert Kern
Andrew Koenig wrote: > "Robert Kern" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Andrew Koenig wrote: > >>>I'm pretty sure that there was a change to the copyright laws a few years >>>ago (perhaps as part of the DMCA), that made it clear that you own >>>everything you produ

Re: CGI question

2005-11-29 Thread Istvan Albert
See urlparse: http://www.python.org/doc/current/lib/module-urlparse.html -- http://mail.python.org/mailman/listinfo/python-list

Looking for good beginner's tutorial

2005-11-29 Thread Roy Smith
My wife wants to learn Python. Can anybody suggest a good tutorial for her to read? She's a PhD molecular biologist who is a pretty advanced Unix user. She mucks about with Perl scripts doing things like text processing and even some simple CGI scripts, but has no formal programming training. I

  1   2   >