test

2006-02-10 Thread Bock
test comp.lang.python -- http://mail.python.org/mailman/listinfo/python-list

Re: installing python on a server?

2006-02-10 Thread Terry Hancock
On Fri, 10 Feb 2006 20:22:07 GMT John Salerno <[EMAIL PROTECTED]> wrote: > Can anyone tell me how complicated it might be to install > Python on my server so I can use it for web apps? Is it a > one-time process, or something to maintain? Installing Python on a server is really, really easy. At

"Is" is "is" [was: any way to customize the is operator?]

2006-02-10 Thread Steve Holden
Lonnie Princehouse wrote: >>Why did you want to customize "is"? > > > Well, mostly out of principle ;-) > > But also because I'm wrapping a C library which passes around C structs > which are wrapped in shim C++ classes for a Boost.Python layer. Boost > Python does a marvelous job of translatin

Re: Legality of using Fonts

2006-02-10 Thread Terry Hancock
On 10 Feb 2006 09:08:28 -0800 "Kamilche" <[EMAIL PROTECTED]> wrote: > Let's say I own a font, and use it in a paint program to > 'draw some text' on a picture that I slap up on the > Internet. Everything's probably fine, right? But what if I > draw some text on a bitmap on the hard drive, add drop

Re: is there a better way?

2006-02-10 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > But this seems ugly to me, and using "while" give me the heebies. Is > there a better approach? Note that "list" is the name of a built-in type; I used "mylist". Alex Martelli described how to do it in log n time using the bisect module. Here's a

Re: is there a better way?

2006-02-10 Thread Alex Martelli
[EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Problem: > > You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the list ends with

Re: Inserting record with Microsoft Access

2006-02-10 Thread Tim Roberts
"jeffhg582003" <[EMAIL PROTECTED]> wrote: > >I am developing a python script which add records to >a microsoft access tables. All my tables have autogenerated number >fields. I am trying to capture the number generated from the insert but >I am not exactly sure how to do that after an insert. htt

Re: by reference

2006-02-10 Thread Tim Roberts
"dirvine" <[EMAIL PROTECTED]> wrote: > >Thanks but I am a bit unsure as to what error I have made by posting >this question. I am not trying to be funny but can you give me a >pointer to the issue. The problem is that your question is quite unclear. I suggest that you post your exact Python code,

Re: installing python on a server?

2006-02-10 Thread John Salerno
Renato wrote: > You mentioned using python for web apps: with which framework? > (TurboGears, CherryPy, Subway, Django, whatever) Or only for cgi? > > With which web server? (Apache, Twisted, Zope, etc.) > > On which linux platform? (Slackware, Debian, Fedora/RedHat, Suse, etc) > > I think you'l

Re: Scientific Computing with NumPy

2006-02-10 Thread Alex Martelli
David M. Cooke <[EMAIL PROTECTED]> wrote: > "linda.s" <[EMAIL PROTECTED]> writes: > > > where to download numpy for Python 2.3 in Mac? > > Thanks! > > Linda > > I don't know if anybody's specifically compiled for 2.3; I think most > of the developers on mac are using 2.4 :-) However, what comes

Re: Yet another GUI toolkit question...

2006-02-10 Thread Kevin Walzer
Dan Sommers wrote: > On Fri, 10 Feb 2006 19:16:36 -0500, > Kevin Walzer <[EMAIL PROTECTED]> wrote: > >> For what it's worth, my application has to run on OS X and Windows, >> and will be commercial, so this combination of requirements rules out >> PyGTK/PyQt/just about every other cross-platform G

Re: Legality of using Fonts

2006-02-10 Thread Robert Kern
Ross Ridge wrote: > Steven D'Aprano wrote: > >>It is highly unlikely that any judge will be fooled by a mere change in >>format ("but Your Honour, I converted the TTF file into a bitmap"). > > If that were true, almost the entire X11 bitmap font collection would > be illegal. Fonts aren't subjec

Re: Legality of using Fonts

2006-02-10 Thread Ross Ridge
Steven D'Aprano wrote: > It is highly unlikely that any judge will be fooled by a mere change in > format ("but Your Honour, I converted the TTF file into a bitmap"). If that were true, almost the entire X11 bitmap font collection would be illegal. Fonts aren't subject copyright, just the hints i

Re: functional 0.5 released

2006-02-10 Thread bonono
Collin Winter wrote: > As always, feedback welcome! Any specific reason flip only flip the first 2 arguments rather than the whole tuple ? That is, I would like to see: assert(f(a,b,c, d) == flip(f)(d, c, b, a)) -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another GUI toolkit question...

2006-02-10 Thread Dan Sommers
On Fri, 10 Feb 2006 19:16:36 -0500, Kevin Walzer <[EMAIL PROTECTED]> wrote: > For what it's worth, my application has to run on OS X and Windows, > and will be commercial, so this combination of requirements rules out > PyGTK/PyQt/just about every other cross-platform GUI toolkit. According to th

Re: Socket Programming - Question

2006-02-10 Thread Grant Edwards
On 2006-02-11, D <[EMAIL PROTECTED]> wrote: > I've used os.popen() before, but if I execute it on a remote > system how could I get the output back to the requesting > machine? Write it to the socket? -- Grant Edwards grante Yow! Where does it go when

Re: Jython inherit from Java class

2006-02-10 Thread Frank LaFond
Jython 2.2 Alpha 1 supports Java 1.5 Frank. Kent Johnson wrote: > Mark Fink wrote: > >> I observed something strange when I tried to compile the jython class: >> 'assert' is a keyword, and may not be used as an identifier >> (try -source 1.3 or lower to use 'assert' as an identifier) >> publ

Re: Socket Programming - Question

2006-02-10 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > I am relatively new to Python, and wanted to see if this is even > possible, and if so how to go about implementing it. What I'm looking > to do is create a client/server application that does the following: > > 1) System2 listens on port > 1023

Re: Socket Programming - Question

2006-02-10 Thread D
I've used os.popen() before, but if I execute it on a remote system how could I get the output back to the requesting machine? -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Programming - Question

2006-02-10 Thread D
Thanks! Now, I'm a bit confused as to exactly how it works - will it display the output of what it executes on the target system? I would like to create a window in Tktinker to where a user can select options (such as run scan on remote system) - it would then run the command-line based scan and

Re: absolute removal of '\n' and the like

2006-02-10 Thread S Borg
Steven, Thank you very much for your insights. They are quite helpful. S -- http://mail.python.org/mailman/listinfo/python-list

Re: breaking from loop

2006-02-10 Thread George Sakkis
Using the (non-standard yet) path module (http://www.jorendorff.com/articles/python/path/), your code can be simplified to: from path import path, copy def copy_first_match(repository, filename, dest_dir): try: first_match = path(repository).walkfiles(filename).next() except StopI

Re: equivalent functions?

2006-02-10 Thread wietse
Got it! Thanks for your time. -- http://mail.python.org/mailman/listinfo/python-list

Re: equivalent functions?

2006-02-10 Thread wietse
Got it! Thanks for your time. -- http://mail.python.org/mailman/listinfo/python-list

Re: equivalent functions?

2006-02-10 Thread Lonnie Princehouse
Very close... it is equivalent to: apply_each = lambda fns, args=[]: [f(*args) for f in fns] The asterisk in f(*args) expands the sequence to fill the arguments to f, where as f(args) would pass the args as only the first argument to the function. apply is deprecated, replaced by the syntax:

equivalent functions?

2006-02-10 Thread wietse
Hello, I'm reading "Text processing in Python" by David Mertz. In there he defines a function apply_each = lambda fns, args=[]: map(apply, fns, [args]*len(fns)) I thought that this would be equivalent to: apply_each = lambda fns, args=[]: [f(args) for f in fns] Can anybody confirm this? If no

Re: Scientific Computing with NumPy

2006-02-10 Thread David M. Cooke
"linda.s" <[EMAIL PROTECTED]> writes: > where to download numpy for Python 2.3 in Mac? > Thanks! > Linda I don't know if anybody's specifically compiled for 2.3; I think most of the developers on mac are using 2.4 :-) But (assuming you have the developer tools installed) it's really to compile:

Re: Socket Programming - Question

2006-02-10 Thread Grant Edwards
On 2006-02-11, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am relatively new to Python, and wanted to see if this is > even possible, and if so how to go about implementing it. > What I'm looking to do is create a client/server application > that does the following: > > 1) System2 listens on

PySizeof: almost useful

2006-02-10 Thread Ian Leitch
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi list, I'm writing a little module to calculate the size of given objects, I just need a few little pointers to get the thing into a useful shape. Code here: http://dev.gentoo.org/~port001/Code/PySizeof/ The points I'm confused about are: 1. My m

Re: Socket Programming - Question

2006-02-10 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > An example of what I am looking to use this for is for remote virus > scanning. So System2 listens, System1 connects and sends it the Just found this through OSNews: http://rpyc.sourceforge.net/ It actually seems to be a perfect fit for your job. Lorenzo -- http://

Re: Legality of using Fonts

2006-02-10 Thread Kamilche
Yeah, that's what I'm thinking, as well. Showing all the text on an image is one thing... using that image as the basis of a font engine is something different. Luckily, someone has sent me a link to a set of free TrueType fonts - http://www.gnome.org/fonts , the 'Vera' family. I guess I'll turn t

Re: is there a better way?

2006-02-10 Thread Dave Hansen
On Sat, 11 Feb 2006 01:37:59 +0100 in comp.lang.python, Schüle Daniel <[EMAIL PROTECTED]> wrote: >Lonnie Princehouse wrote: >> everybody is making this way more complicated than it needs to be. >> >> storage = list[:list.index(O)] > >the question is whether the old list is needed in the future or

Re: arrays in python

2006-02-10 Thread plahey
> Oh, don't tell me, I love playing guessing games! Don't you mean "No no... don't tell me. I'm keen to guess." Sorry, I couldn't resist... :-) (for those who just went huh?, see http://www.aldo.com/sgt/CheeseShoppeSkit.htm) -- http://mail.python.org/mailman/listinfo/python-list

Re: any way to customize the is operator?

2006-02-10 Thread Lonnie Princehouse
> Why did you want to customize "is"? Well, mostly out of principle ;-) But also because I'm wrapping a C library which passes around C structs which are wrapped in shim C++ classes for a Boost.Python layer. Boost Python does a marvelous job of translating between Python and C++ data types; when

Re: absolute removal of '\n' and the like

2006-02-10 Thread Steven D'Aprano
On Fri, 10 Feb 2006 15:21:58 -0800, S Borg wrote: > Hello, > > If I have a string, what is the strongest way to assure the > removal of any line break characters? What do you mean "strongest"? Fastest, most memory efficient, least lines of code, most lines of code, least bugs, or just a vague "

Re: arrays in python

2006-02-10 Thread Steven D'Aprano
On Fri, 10 Feb 2006 17:50:21 -0500, Kermit Rose wrote: > I want to write a program in python using integer arrays. > > I wish to calculate formulas using 200 digit integers. Must the integers have exactly 200 digits? If you multiply one of these 200-digit integers by ten, should it silently ove

Yet another GUI toolkit question...

2006-02-10 Thread Kevin Walzer
...with a twist. I'm undertaking my first semi-substantial Python GUI application after a long time dabbling with the language. I'm fairly experienced with Tcl/Tk, so Tkinter seems the obvious choice to reduce my Python learning curve. However, my Tcl applications typically make use of a *lot* of

Re: cmd

2006-02-10 Thread Steven D'Aprano
On Sat, 11 Feb 2006 00:47:14 +0100, Gerber wrote: > I'd like some documentation on the cmd module, besides the regular > docs, in help() and docs.python.org... Is this a trick question? You'd like some documentation apart from the documentation? Have you tried reading the source code to the modu

Socket Programming - Question

2006-02-10 Thread [EMAIL PROTECTED]
I am relatively new to Python, and wanted to see if this is even possible, and if so how to go about implementing it. What I'm looking to do is create a client/server application that does the following: 1) System2 listens on port > 1023 2) System1 connects to System2 and sends traffic to it -

Re: absolute removal of '\n' and the like

2006-02-10 Thread S Borg
Russ, Thanks a ton for ending a 3 day headache. S -- http://mail.python.org/mailman/listinfo/python-list

Re: module with __call__ defined is not callable?

2006-02-10 Thread Bengt Richter
On Thu, 9 Feb 2006 10:07:49 +1100, "Delaney, Timothy (Tim)" <[EMAIL PROTECTED]> wrote: >Steven D'Aprano wrote: > >> That's not a _reason_, it is just a (re-)statement of fact. We know >> that defining a __call__ method on a module doesn't make it callable. >> Why not? The answer isn't "because de

installing matplotlib in cygwin

2006-02-10 Thread nashmeister
has anyone had any success compiling matplotlib in cygwin? i had some rebasing problems that i got around, but when i finally got everything to install without any complaints and did "import pylab" i got dumped out of python altogether without any errors. some thing i did: cd /usr/lib ln -s libt

Re: is there a better way?

2006-02-10 Thread Scott David Daniels
Scott David Daniels wrote: > [EMAIL PROTECTED] wrote: >> Problem: >> >> You have a list of unknown length, such as this: list = >> [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know >> the X's are all up front and you know that the item after the last X is >> an O, or that the li

Re: ordered sets operations on lists..

2006-02-10 Thread bonono
Raymond Hettinger wrote: > The intersection step is unnecessary, so the answer can be simplified a > bit: > > >>> filter(set(l2).__contains__, l1) > [5, 3] > >>> filter(set(l1).__contains__, l2) > [3, 5] stand corrected. -- http://mail.python.org/mailman/listinfo/python-list

cmd

2006-02-10 Thread Gerber
I'd like some documentation on the cmd module, besides the regular docs, in help() and docs.python.org... Gerber -- http://mail.python.org/mailman/listinfo/python-list

Re: read-only attributes

2006-02-10 Thread john peter
Thank you for the suggestion!bruno at modulix <[EMAIL PROTECTED]> wrote: limodou wrote:> On 2/10/06, john peter wrote:(snip)>> what do i have to do if i want my application code to have>>read-only>> attributes?>>> I think you may consider property() built-in function:> > property( [fget[, fset[,

Re: installing python on a server?

2006-02-10 Thread 3c273
"Renato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -snip- > On systems with package management (pretty much all of them, except > Slack) install is a matter of a few commands. And you can automate it, > obviously. Slackware has package management, (pkgtool, installpkg, removepkg,

Re: arrays in python

2006-02-10 Thread Schüle Daniel
> I want to write a program in python using integer arrays. you can :) > I wish to calculate formulas using 200 digit integers. no problem > I could not find any documentation in python manual about declaring arrays. > > I searched the internet read here http://diveintopython.org/native_dat

Re: absolute removal of '\n' and the like

2006-02-10 Thread Russell Blau
"S Borg" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > If I have a string, what is the strongest way to assure the > removal of any line break characters? > > Line break characters must always be the last character in a line, so > would > this:str = linestring[:-1] > > work?

Re: Legality of using Fonts

2006-02-10 Thread Steven D'Aprano
On Fri, 10 Feb 2006 09:08:28 -0800, Kamilche wrote: > I have a question for all you Pythoneers out there. I'm making a game > with Python, and have a need for fonts. I am currently using a free > TrueType font, but am considering switching to a bitmap font instead. > > Let's say I own a font, and

Re: appending to a list via properties

2006-02-10 Thread Larry Bates
Lonnie Princehouse wrote: > Here's a curious hack I want to put up for discussion. I'm thinking of > writing a PEP for it. > > Observation > - > I found myself using this construct for assembling multiple lists: > > foo = [] > qux = [] > > while some_condition: >

absolute removal of '\n' and the like

2006-02-10 Thread S Borg
Hello, If I have a string, what is the strongest way to assure the removal of any line break characters? Line break characters must always be the last character in a line, so would this:str = linestring[:-1] work? This is my first real 'learning python' project, and I don't want to get i

Re: arrays in python

2006-02-10 Thread Steve Holden
Kermit Rose wrote: > From: Kermit Rose > Date: 02/10/06 17:36:34 > To: [EMAIL PROTECTED] > Subject: Arrays > > > Hello. > > I want to write a program in python using integer arrays. > > I wish to calculate formulas using 200 digit integers. > > I could not find any documentation in pytho

arrays in python

2006-02-10 Thread Kermit Rose
From: Kermit Rose Date: 02/10/06 17:36:34 To: [EMAIL PROTECTED] Subject: Arrays Hello. I want to write a program in python using integer arrays. I wish to calculate formulas using 200 digit integers. I could not find any documentation in python manual about declaring arrays. I searched

Re: Daemon terminates unexpected

2006-02-10 Thread Steve Horsley
Incorporating Fredrik's fix (I learned something new reading that), try using an endless loop even if there is an exception like this: def run(self): while True: try: time.sleep(60) # wait, avoid spinning so that ev

Re: installing python on a server?

2006-02-10 Thread Rene Pijlman
John Salerno: >Hmm, sounds easy, yet I don't know where to start. try: browser.browse(http://www.python.org/download/) package = download(yourPlatform) package.unpack() exec(README.read()) except: post specifics -- René Pijlman -- http://mail.python.org/mailman/listinfo/pyt

Re: * 'struct-like' list *

2006-02-10 Thread Bengt Richter
On Tue, 07 Feb 2006 18:10:05 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: [...] >< ernesto.py >- [...] Just noticed: >substrings = line.split() >if substrings and isinstance(substrings, list) and substrings[0] == > 'Name:

Re: installing python on a server?

2006-02-10 Thread Renato
You mentioned using python for web apps: with which framework? (TurboGears, CherryPy, Subway, Django, whatever) Or only for cgi? With which web server? (Apache, Twisted, Zope, etc.) On which linux platform? (Slackware, Debian, Fedora/RedHat, Suse, etc) I think you'll have to think about other qu

Re: Question about idioms for clearing a list

2006-02-10 Thread Bryan Olson
Magnus Lycka wrote: > Bryan Olson wrote: > >> Magnus Lycka wrote: >> >>> Bryan Olson wrote: >>> big_union = set() for collection in some_iter: big_union.update(t) collection.clear() >>> >>> >>> I don't understand the second one. Where did 't' come from?

Re: is there a better way?

2006-02-10 Thread Schüle Daniel
I don't want to hijack the thread I was thinking whether something like lst.remove(item = 0, all = True) would be worth adding to Python? it could have this signature def remove(item, nItems = 1, all = False) ... return how_many_deleted lst.remove(item = 0, nItems = 1) lst.remove

Re: in over my head ascii

2006-02-10 Thread Blair P. Houghton
[EMAIL PROTECTED] wrote: > so. how do i make 200 occupy 4 bytes ? Did you double-check that they didn't want "0200" in ascii in the message? As in: STX0200ENX Because that's always possible. And, if you're _lucky_, they designed the innards of the message so that "ENX" ca

Re: how to kill a python process?

2006-02-10 Thread Steve Horsley
MackS wrote: > Hello! > > This question does not concern programming in python, but how to manage > python processes. Is there a way to "name" a python process? At least > on Linux, if I have two python programs running, they both run under > the name "python" > > #pidof program1.py > [empty line

Re: is there a better way?

2006-02-10 Thread Schüle Daniel
Lonnie Princehouse wrote: > everybody is making this way more complicated than it needs to be. > > storage = list[:list.index(O)] the question is whether the old list is needed in the future or not if not then it would be easer/mor efficient to use del lst[lst.index(0):] Regards, Daniel -- ht

two generators working in tandem

2006-02-10 Thread john peter
I'd like to write two generators: one is a min to max sequence number generator that rolls over to min again once the max is reached. the other is a generator that cycles through N (say, 12) labels. currently, i'm using these generators in nested loops like this:   seq_numbers = genSeqNum(min,

Re: is there a better way?

2006-02-10 Thread Jeremy Dillworth
You could eliminate a few lines like this: - while list and list[0] != O: storage.append(list.pop(0)) - Adding the "list and " to the front of the logic test will catch when there are 0 elements, so the "if..break" lines are not needed.

appending to a list via properties

2006-02-10 Thread Lonnie Princehouse
Here's a curious hack I want to put up for discussion. I'm thinking of writing a PEP for it. Observation - I found myself using this construct for assembling multiple lists: foo = [] qux = [] while some_condition: a, b = calculate_something() foo.append

Re: installing python on a server?

2006-02-10 Thread John Salerno
Rene Pijlman wrote: > John Salerno: >> Can anyone tell me how complicated it might be to install Python on my >> server so I can use it for web apps? > > 2 on a scale from 1 to 10. > >> Is it a one-time process, or something to maintain? > > Both :-) > > I installed Python 2.2 - 2.4 from sourc

Re: installing python on a server?

2006-02-10 Thread Rene Pijlman
John Salerno: >Can anyone tell me how complicated it might be to install Python on my >server so I can use it for web apps? 2 on a scale from 1 to 10. >Is it a one-time process, or something to maintain? Both :-) I installed Python 2.2 - 2.4 from source on Linux with no problem whatsoever. I n

installing python on a server?

2006-02-10 Thread John Salerno
Can anyone tell me how complicated it might be to install Python on my server so I can use it for web apps? Is it a one-time process, or something to maintain? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replacing curses

2006-02-10 Thread Ian Ward
Ross Ridge wrote: > In general it's impossible to know how many display positions some > random Unicode character might use. For example, Chinese characters > normally take two display positions, but the terminal your using might > not support them and display a single width replacement character.

Re: Jython inherit from Java class

2006-02-10 Thread Kent Johnson
Mark Fink wrote: > I observed something strange when I tried to compile the jython class: > 'assert' is a keyword, and may not be used as an identifier > (try -source 1.3 or lower to use 'assert' as an identifier) > public static void assert(PyObject test, PyObject message) { > Looks like some

Re: is there a better way?

2006-02-10 Thread Lonnie Princehouse
everybody is making this way more complicated than it needs to be. storage = list[:list.index(O)] incidentally, "list" is the name of a type, so you might want to avoid using it as a variable name. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pulling all n-sized combinations from a list

2006-02-10 Thread [EMAIL PROTECTED]
Magnus Lycka wrote: > [EMAIL PROTECTED] wrote: > > But using the free SDK compiler from MS? That seems elusive. > > Have you seen this? > http://www.vrplumber.com/programming/mstoolkit/ I have, although I haven't tried it as I was able to get a GMPY Windows binary from someone else. It may be tha

Re: Jython inherit from Java class

2006-02-10 Thread Mark Fink
I observed something strange when I tried to compile the jython class: D:\AUT_TEST\workspace\JyFIT\fit>jythonc JyFitServer.py processing JyFitServer Required packages: fitnesse.util java.io java.net fitnesse.components* Creating adapters: Creating .java files: JyFitServer module Jy

Re: is there a better way?

2006-02-10 Thread Schüle Daniel
[...] > I have been using something like this: > _ > > while list[0] != O: > storage.append(list[0]) > list.pop(0) > if len(list) == 0: > break > _ > > But this seems ugly to me, and using "while" give me the heebies. Is > there a bett

Re: is there a better way?

2006-02-10 Thread Schüle Daniel
[...] > > What not > > for x in list: > if x == O: > break > storage.append(x) > i think this may take too long better aproach would be to test for zero from the end Regards, Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: ordered sets operations on lists..

2006-02-10 Thread Raymond Hettinger
[Amit Khemka] > > Hello, Is there a *direct* way of doing set operations on lists which > > preserve the order of the input lists ? > > For Ex. l1 = [1, 5, 3, 2, 4, 7] > > l2 = [3, 5, 10] > > > > and (l1 intersect l2) returns [5, 3] (and (l2 intersect l1) [bonono] > what d

Re: is there a better way?

2006-02-10 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > Problem: > > You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the list ends with an X. There are neve

Re: Legality of using Fonts

2006-02-10 Thread Scott David Daniels
Kamilche wrote: > I have a question for all you Pythoneers out there. I'm making a game > with Python, and have a need for fonts. I am currently using a free > TrueType font, but am considering switching to a bitmap font instead. > > Let's say I own a font, and use it in a paint program to T

Re: ordered sets operations on lists..

2006-02-10 Thread Scott David Daniels
Amit Khemka wrote: > Hello, Is there a *direct* way of doing set operations on lists which > preserve the order of the input lists ? Nope > For Ex. l1 = [1, 5, 3, 2, 4, 7] > l2 = [3, 5, 10] > > and (l1 intersect l2) returns [5, 3] (and (l2 intersect l1) > returns [3, 5])

Re: Newbie Q: dynamically assigning object attribute

2006-02-10 Thread Ben Wilson
Well, my Perl way of doing it would be to have all attributes in a dict (hash), then create the accessor vi a dynamic function. I knew Python would have a right way to do it for Python, but when I went looking I neglected to look at the core of the language. I suppose I'm just too accustomed to the

Re: by reference

2006-02-10 Thread dirvine
Thanks but I am a bit unsure as to what error I have made by posting this question. I am not trying to be funny but can you give me a pointer to the issue. Many thanks David -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter, X-windows and ebay

2006-02-10 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Bob Greschke <[EMAIL PROTECTED]> wrote: > >"Paul Rubin" wrote in message >news:[EMAIL PROTECTED] >> "Bob Greschke" <[EMAIL PROTECTED]> writes: >>> What I came up with was the user can just create a text file (a kind >>> of a transaction lo

Martin Franklin's Tkinter/Tile wrapper--where'd it go?

2006-02-10 Thread Kevin Walzer
I believe Martin Franklin wrote a Tile.py wrapper for the Tk/Tile extension, which adds theming to the core Tk widget set. It used to reside here: http://mfranklin.is-a-geek.org/docs/Tile/index.html That server seems to be down. Anyone know if the wrapper is available elsewhere? Or if someone els

Re: html entity to unicode

2006-02-10 Thread Peter Maas
[EMAIL PROTECTED] schrieb: > Hi, > > I'm parsing html. I have a page with a lot of html enitties for hebrew > characters. When i print what i get are blanks, dots and commas. How > can i decode this entities to unicode charachters? Python doc 13.4 htmlentitydefs -- Definitions of HTML general en

ANN: Python interface to Microsoft Outlook Web Access

2006-02-10 Thread Adrian Holovaty
Hi all, Because I telecommute, I'm limited to using my company's webmail interface, Microsoft Outlook Web Access, rather than having direct POP or IMAP access to e-mail. This isn't ideal, for several reasons: * Outlook Web Access has a horrendous user interface in any browser other than Inter

Re: random playing soundfiles according to rating.

2006-02-10 Thread Ben Cartwright
kpp9c wrote: > I've been looking at some of the suggested approaches and looked a > little at Michael's bit which works well bisect is a module i > always struggle with (hee hee) > > I am intrigued by Ben's solution and Ben's distilled my problem quite > nicely Thanks!-) Actually, you should

Re: get output of cmd-line command under MS windows

2006-02-10 Thread calmar
On 2006-02-08, Bernard Lebel <[EMAIL PROTECTED]> wrote: Hi Bernhard and all, > oPipe = os.popen( "run C:/program files/my app/executable.exe" ) > > while 1: > sLine = oPipe.read() > print sLine > if sLine == '': > print 'No more line from pipe, exit.' >

Re: is there a better way?

2006-02-10 Thread Paul McGuire
"Paul McGuire" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Problem: > > > > You have a list of unknown length, such as this: list = > > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > > the X

Re: is there a better way?

2006-02-10 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Problem: > > You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the li

Re: is there a better way?

2006-02-10 Thread Tim Chase
> You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the list ends with an X. There are never O's between > X's. > > I have been u

Re: is there a better way?

2006-02-10 Thread snoe
[EMAIL PROTECTED] wrote: > Problem: > > You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the list ends with an X. There are neve

Re: Are there memory limits for external C modules?

2006-02-10 Thread [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote: > I was able to modify my C code so that instead of being a Python > module, it runs as a standalone binary, and it works as it should. > Calling it with os.spawn* works. The two versions are essentially the > same, the primary differences being the necessary difference in

Re: Newbie Q: dynamically assigning object attribute

2006-02-10 Thread Sion Arrowsmith
Ben Wilson <[EMAIL PROTECTED]> wrote: >I would like to dynamically assign object attributes: > >dict = { > a : 1, > b : 2, >} > >for key,val in dict : > obj.key = val > >I've googled to no effect, or maybe I'm needing to be hit with the >appropriately sized clue-by-four. The conventional clue-by-

Re: is there a better way?

2006-02-10 Thread Jeremy Sanders
[EMAIL PROTECTED] wrote: > You have a list of unknown length, such as this: list = > [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know > the X's are all up front and you know that the item after the last X is > an O, or that the list ends with an X. There are never O's between

is there a better way?

2006-02-10 Thread [EMAIL PROTECTED]
Problem: You have a list of unknown length, such as this: list = [X,X,X,O,O,O,O]. You want to extract all and only the X's. You know the X's are all up front and you know that the item after the last X is an O, or that the list ends with an X. There are never O's between X's. I have been using

Re: Jython inherit from Java class

2006-02-10 Thread Mark Fink
Alan, Kent, many thanks this really helped! But there is still a problem I guess with inheritance. I use the java testsuit supplied with the original to test the server. If I use the Java FitServer the testsuite can be completed. I commented everything out from my class and it does not work?? Thats

Re: Tkinter, X-windows and ebay

2006-02-10 Thread Bob Greschke
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > "Bob Greschke" <[EMAIL PROTECTED]> writes: >> What I came up with was the user can just create a text file (a kind >> of a transaction log of what things were done to the copy of the >> database on his machine), the

Re: AdaptionFailure: How to use Interfaces with PyProtocols ?

2006-02-10 Thread Nebur
Yes, I adapted the instance, and it's working.That's it. Thank you ! Nebur -- http://mail.python.org/mailman/listinfo/python-list

Re: ordered sets operations on lists..

2006-02-10 Thread bonono
Amit Khemka wrote: > Hello, Is there a *direct* way of doing set operations on lists which > preserve the order of the input lists ? > For Ex. l1 = [1, 5, 3, 2, 4, 7] > l2 = [3, 5, 10] > > and (l1 intersect l2) returns [5, 3] (and (l2 intersect l1) > returns [3, 5]) > what

  1   2   >