Re: ANN: PyQt v4.1 Released

2006-11-09 Thread Tool69
Shame on me, I forgot to import the lexers. -- http://mail.python.org/mailman/listinfo/python-list

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread robert
robert wrote: > -- > 0040101F mov eax,3B9ACA00h > 13: for (i = 0; i < count; ++i) { > 14: __asm lock inc x; > 00401024 lock incdword ptr [_x (00408a00)] > 15: sum += x; > 0040102B mov edx,dword ptr [_x (00408a00)] > 00401031 add e

Re: urllib.urlopen: Errno socket error

2006-11-09 Thread frifri007
[EMAIL PROTECTED] a écrit : > Hi, > > I'm just trying to read from a webpage with urllib but I'm getting > IOErrors. This is my code: > > import urllib > sock = urllib.urlopen("http://www.google.com/";) > > and this is the error: > > Traceback (most recent call last): > File "", line 1, in >

Re: Multithreaded C API Python questions

2006-11-09 Thread Hendrik van Rooyen
"Svein Seldal" <"svein at seldal dot com">wrote: 8<--- > I am dependent upon the ability to have to threads executing in python > land at the same time. How can this be done? call time.sleep(0.001) in each, as well as the main thread, to politely giv

Re: substring search without using built in utils

2006-11-09 Thread Hendrik van Rooyen
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote: 8<-- > Given a source list, find the offset of a target sub-list within the > source list, in other words, find for lists. > > i.e. search(source, target) returns n if source[n:n+len(target)] == target > for any sequence type. >

Re: how is python not the same as java?

2006-11-09 Thread John Henry
gavino wrote: > both are interpreted oo langauges.. I remember the days when I got all excited about Java (many many moons ago when Java first came out). I brought a whole truckload of books on it, even spent 5 days attending a seminar on the subject. To my great disappointment, I never g

Re: Printing to file, how do I do it efficiently?

2006-11-09 Thread Robert Kern
Cameron Walsh wrote: > Hi all, > > I have a numpy.array of 89x512x512 uint8's, set up with code like this: numpy questions are best asked on the numpy list, not here. http://www.scipy.org/Mailing_Lists > data=numpy.array([],dtype="uint8") > data.resize((89,512,512)) You might want to look at

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread John Henry
Upon closer look, the walkthrough did say: *** from PythonCard import model Change that so it says: from PythonCard import dialog, model Save the code. *** So, it works. John Henry wrote: > Bill Maxwell wrote: > > On 8 Nov 2006 11:49:07 -0800,

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread John Henry
Bill Maxwell wrote: > On 8 Nov 2006 11:49:07 -0800, "John Henry" <[EMAIL PROTECTED]> > wrote: > > > > >John Salerno wrote: > >> Dan Lenski wrote: > >> > >> > So, is there another toolkit I should be looking at? > >> > >> I highly recommend wxPython. It's very mature, full-featured, and > >> portabl

Re: how is python not the same as java?

2006-11-09 Thread George Sakkis
how are BMWs not the same with Yugos ? both have four wheels and burn gasoline. -- http://mail.python.org/mailman/listinfo/python-list

Printing to file, how do I do it efficiently?

2006-11-09 Thread Cameron Walsh
Hi all, I have a numpy.array of 89x512x512 uint8's, set up with code like this: data=numpy.array([],dtype="uint8") data.resize((89,512,512)) # Data filled in about 4 seconds from 89 image slices I first tried writing this data to a binary raw format (for use in a program called Drishti) as fo

Re: how is python not the same as java?

2006-11-09 Thread Ray
[EMAIL PROTECTED] wrote: > Jython exists. And Pava (or Pyava) doesn't, you mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: Searching for a module to generate GUI events

2006-11-09 Thread Stephan Kuhagen
utabintarbo wrote: > http://pywinauto.pbwiki.com/ for Win32 Thanks for the hint, looks usable. But it seems, there's nothing for X11 and MacOSX. I didn't thought, that the problem would be so unusual... Stephan -- http://mail.python.org/mailman/listinfo/python-list

Re: how is python not the same as java?

2006-11-09 Thread p . lavarre
Jython exists. -- http://mail.python.org/mailman/listinfo/python-list

to Doctest as SystemExit is to Python

2006-11-09 Thread p . lavarre
> From: http://docs.python.org/lib/doctest-soapbox.html ... > Regression testing is best confined to dedicated objects or files ... Can I somehow tell doctest that it's time to quit? I ask because not all doctest examples are created equal. Some failures are catastrophic, making all subsequent f

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Bill Maxwell
On 8 Nov 2006 11:49:07 -0800, "John Henry" <[EMAIL PROTECTED]> wrote: > >John Salerno wrote: >> Dan Lenski wrote: >> >> > So, is there another toolkit I should be looking at? >> >> I highly recommend wxPython. It's very mature, full-featured, and >> portable, and fairly easy to learn as well. I ca

Re: how is python not the same as java?

2006-11-09 Thread Ben Finney
Steve Holden <[EMAIL PROTECTED]> writes: > Java is horrible, Oython is not. Is that the predecessor to Python, the one that could only be expressed in vowel noises? -- \"Beware of and eschew pompous prolixity." -- Charles A. | `\

Re: how is python not the same as java?

2006-11-09 Thread Tim Chase
> Java is horrible, Oython is not. Oython...the new scripting language from down under...just a wee bit south of the island of Java... g'day-mate'ly yers... -tkc -- http://mail.python.org/mailman/listinfo/python-list

Re: Having problems with urlparser concatenation

2006-11-09 Thread i80and
Thank you! Fixed my problem perfectly! Gabriel Genellina wrote: > At Thursday 9/11/2006 20:23, i80and wrote: > > >I'm working on a basic web spider, and I'm having problems with the > >urlparser. > >[...] > > SpliceStart = Website.find('', SpliceStart)) > > > > ParsedURL =

Re: pack a three byte int

2006-11-09 Thread Gabriel Genellina
At Friday 10/11/2006 00:08, [EMAIL PROTECTED] wrote: > > >>> import binascii > > >>> cdb = binascii.unhexlify('%02X%06X%02X%02X' % (0x08, 0x12345, 0x80, 0)) > > >>> binascii.hexlify(cdb) > >'080123458000' > > The only problem I can see is that this code is endianness-dependent; > the suggested

Re: how is python not the same as java?

2006-11-09 Thread Steve Holden
gavino wrote: > both are interpreted oo langauges.. > Java is horrible, Oython is not. regards Steve -- Steve Holden +44 150 684 7255 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://holdenweb.blogspot.com Recent Ramblings http:/

Re: Excel file read/write?

2006-11-09 Thread John Machin
Podi wrote: > > > > > 2. OpenOffice.org has a built-in Python -- 2.n where n is a small > > number :-( and almost impenetrable documentation -- Sybren Stuvel has > > published some examples: http://www.stuvel.eu/ooo-python > > but my guess is that all the users of the OOo interface could fit in a

Re: how is python not the same as java?

2006-11-09 Thread Paddy
gavino wrote: > both are interpreted oo langauges.. One can curl; the other, one can suck! (Its early, I'm sure this will not be as funny at more decent hours). Gavino, I suggest you take a very small problem, something like computing pascals triangle for example, and write implementations

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> > ... Python can say six-nybble hex: > > > > >>> import binascii > > >>> cdb = binascii.unhexlify('%02X%06X%02X%02X' % (0x08, 0x12345, 0x80, 0)) > > >>> binascii.hexlify(cdb) > >'080123458000' > > The only problem I can see is that this code is endianness-dependent; > the suggested versions using

Re: urllib en https

2006-11-09 Thread Podi
> > As I recall, ActiveState doesn't distribute the SSL package that the > > python.org package contains. But... It is possible to copy the SSL > > related files from a python.org package into the ActiveState > > installation. > Are there any instructions on doing this? My Python installation

Registrations are open for tutorials at OSDC 2006

2006-11-09 Thread Richard Jones
Time is running out to register for tutorials at the Open Source Developers' Conference 2006 tutorial program: http://www.osdc.com.au/registration/index.html The tutorials run on the 5th December, followed by the technical program on the 6th - 8th December. Most tutorials include printed

Re: how is python not the same as java?

2006-11-09 Thread John Machin
Jorge Vargas wrote: > On 9 Nov 2006 16:44:40 -0800, gavino <[EMAIL PROTECTED]> wrote: > > both are interpreted oo langauges.. > > > that is not correct java is compiled and the VM interprets the code ... and what do you think is in those pesky little .pyc files you may have noticed lying arou

Re: Excel file read/write?

2006-11-09 Thread Podi
Thanks for the reply. > > Most folk would seem to be using pyExcelerator rather than pyXLWriter. > It is much more up to date, it just hasn't been worked on for a year, I will give it a shot. > 1. Python COM interface (part of > http://sourceforge.net/projects/pywin32/) with lots of users (and h

Re: comparing Unicode and string

2006-11-09 Thread John Machin
Neil Cerutti wrote: > On 2006-10-16, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hello, > > > > here is something that surprises me. > > > > #coding: iso-8859-1 > > I think that's supposed to be: > > # -*- coding: iso-8859-1 -*- > Not quite. As PEP 263 says: """ More precisely, the first

Re: pack a three byte int

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 22:24, [EMAIL PROTECTED] wrote: Perhaps Python can't concisely say three-byte int ... But Python can say six-nybble hex: >>> import binascii >>> cdb = binascii.unhexlify('%02X%06X%02X%02X' % (0x08, 0x12345, 0x80, 0)) >>> binascii.hexlify(cdb) '080123458000' The only pro

Re: Excel file read/write?

2006-11-09 Thread John Machin
Podi wrote: > As far as I know, there is pyXLWriter for writing and xlrd for reading. Most folk would seem to be using pyExcelerator rather than pyXLWriter. It is much more up to date, it just hasn't been worked on for a year, whereas pyXLWriter is obsolete (doesn't write latest Excel file format

Re: how is python not the same as java?

2006-11-09 Thread Jorge Vargas
On 9 Nov 2006 16:44:40 -0800, gavino <[EMAIL PROTECTED]> wrote: > both are interpreted oo langauges.. > that is not correct java is compiled and the VM interprets the code from the programmers point of view java is a compiled languaje. python is dynamic typed java is static python allows func

Re: Simple question to split

2006-11-09 Thread Tiefeng Wu
Matthias Winterland wrote: > Hi, > > I have a simple question. When I read in a string like: > a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a > single split-call? > > Thx, > Matthias Sorry, I didn't notice there are spaces between 5 6 7 :{P here is new code: >>> a = "1,2,3

Re: Simple question to split

2006-11-09 Thread Tiefeng Wu
Matthias Winterland wrote: > Hi, > > I have a simple question. When I read in a string like: > a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a > single split-call? > > Thx, > Matthias Maybe like this: >>> a = "1,2,3,4,5,6,7,3,4" >>> l = [int(n) for n in a.split(',')] >>> l

Re: pack a three byte int

2006-11-09 Thread John Machin
[EMAIL PROTECTED] wrote: > Speaking as the OP, perhaps I should mention: > > > > [-3:] to [1:] is a minor cosmetic improvement > > To my eye, that's Not an improvement. > > '\x08' '\x01\x23\x45' '\x80' '\0' is the correct pack of (0x08, > 0x12345, 0x80, 0) because '\x01\x23\x45' are the significan

Re: pack a three byte int

2006-11-09 Thread John Machin
[EMAIL PROTECTED] wrote: > > Pack ' these things. > > The people who wrote this stuff forty years ago were thinking of bit > fields - here bit lengths of 8 then 3 then 21 then 8 then 8 bits - > cheating only when the bit boundaries happened to hit byte boundaries. > > Yes, as you describe in thi

Re: Tkinter check box behaviour - Windows / Linux discrepancy

2006-11-09 Thread jim-on-linux
Peter, You already have an answer to you question but if you want to fancy up your program you could replace; self.chkTest.bind('', self.chkTest_click) > with > self.chkTest.bind('',self.chkTest_click0) or some other acceptable key from the keyboard > def chkTest_click0(self,event):

Re: pack a three byte int

2006-11-09 Thread p . lavarre
Perhaps Python can't concisely say three-byte int ... But Python can say six-nybble hex: >>> import binascii >>> cdb = binascii.unhexlify('%02X%06X%02X%02X' % (0x08, 0x12345, 0x80, 0)) >>> binascii.hexlify(cdb) '080123458000' >>> Thanks again for patiently helping me find this. A shortcut is:

Re: object data member dumper?

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 22:16, tom arnall wrote: > I'd suggest you instead consider a mixin object that will add recursive > data dump functionality to any such classes you require. have googled a fair amount on 'mixin' but still stumped on it. Try again using "mixin class" -- Gabriel Genelli

Re: pack a three byte int

2006-11-09 Thread John Machin
[EMAIL PROTECTED] wrote: > > "struct" == "Python struct module" > > > > Struct module has (concise) codes B, H, I, Q for unsigned integers of > > lengths 1, 2, 4, 8, but does *not* have a code for 3-byte integers. > > I thought that's what the manual meant, but I was unsure, thank you. If it does

Re: object data member dumper?

2006-11-09 Thread tom arnall
Steve Holden wrote: > tom arnall wrote: >> Steve Holden wrote: >> >> >>>Bruno Desthuilliers wrote: >>> tom arnall a écrit : >does anyone know of a utility to do a recursive dump of object data >members? > What are "object data members" ? (hint: in Python,

Re: pack a three byte int

2006-11-09 Thread p . lavarre
Speaking as the OP, perhaps I should mention: > > [-3:] to [1:] is a minor cosmetic improvement To my eye, that's Not an improvement. '\x08' '\x01\x23\x45' '\x80' '\0' is the correct pack of (0x08, 0x12345, 0x80, 0) because '\x01\x23\x45' are the significant low three bytes of a big-endian x1234

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> > when talking the 1960's lingo > > ... > > X12Inquiry = 0x12 > > xxs = [0] * 6 > > xxs[0] = X12Inquiry > > xxs[4] = allocationLength > > rq = ''.join([chr(xx) for xx in xxs]) > > It looks wrong (and a few other adjectives), Ah, we agree, thank you for saying. > Looks like little-endian 4-byte

Re: comparing Unicode and string

2006-11-09 Thread [EMAIL PROTECTED]
Marc 'BlackJack' Rintsch wrote: > Why? Python strings are *byte strings* and bytes have values in the range > 0..255. Why would you restrict them to ASCII only? Because getting an exception when comparing a string with a unicode string is irritating. But I don't insist on my PEP. The example ju

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> "struct" == "Python struct module" > > Struct module has (concise) codes B, H, I, Q for unsigned integers of > lengths 1, 2, 4, 8, but does *not* have a code for 3-byte integers. I thought that's what the manual meant, but I was unsure, thank you. > > > 1. Not as concisely as a one-byte struct

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> Help, what did you mean by the question? How does Python express the idea: i) Produce the six bytes '\x08' '\x01\x23\x45' '\x80' '\0' at run-time when given the tuple (0x08, 0x12345, 0x80, 0). ii) Produce the six bytes '\x12' '\0\0\0' '\x24' '\0' when given the tuple (0x12, 0, 0x24, 0). iii)

Re: how is python not the same as java?

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 21:44, gavino wrote: both are interpreted oo langauges.. I'd use Google to find thousands of references... -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gra

how is python not the same as java?

2006-11-09 Thread gavino
both are interpreted oo langauges.. -- http://mail.python.org/mailman/listinfo/python-list

Excel file read/write?

2006-11-09 Thread Podi
As far as I know, there is pyXLWriter for writing and xlrd for reading. Is there such thing so that one can open an Excel file into memory and read/update any sheet/cell on the fly. One analogy to this is the ConfigParser module. Any info would be much appreciated. -- http://mail.python.org/mail

Re: urlretrieve get file name

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 20:52, Sven wrote: Thanks for your help, but I'm a guy with no luck. :-) I can't get the file name from response header... Try using a browser and "Save as..."; if it suggests a file name, it *must* be in the headers - so look again carefully. If it does not suggests a f

Re: Tkinter check box behaviour - Windows / Linux discrepancy

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 20:28, peter wrote: I've come across a weird difference between the behaviour of the Tkinter checkbox in Windows and Linux. The issue became apparent in some code I wrote to display an image in a fixed size canvas widget. If a checkbox was set then the image should be shru

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Dan Lenski
Ben Finney wrote: > > I think the colon could be omitted from every type of compound > > statement: 'if', 'for', 'def', 'class', whatever. Am I missing > > anything? > > A use case. What problem is being solved by introducing this > inconsistency? I agree completely. And as a recent convert to Py

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Ben Finney
Please don't hide your new thread as a reply to an existing, unrelated message. Start a new message if your message isn't actually a reply. Michael Hobbs <[EMAIL PROTECTED]> writes: > Can anyone find a flaw with this change in syntax? > > Instead of dividing a compound statement with a colon, why

Re: urlretrieve get file name

2006-11-09 Thread Sven
Hello Gabriel, Thanks for your help, but I'm a guy with no luck. :-) I can't get the file name from response header... On Nov 10, 12:39 am, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > At Thursday 9/11/2006 19:11, Sven wrote: > > >I'm wrestling with the urlretrieve function in the urllib module

Re: Having problems with urlparser concatenation

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 20:23, i80and wrote: I'm working on a basic web spider, and I'm having problems with the urlparser. [...] SpliceStart = Website.find('', SpliceStart)) ParsedURL = urlparse((Website[SpliceStart+9:(SpliceEnd+1)])) robotparser.set_url(Parse

Re: pack a three byte int

2006-11-09 Thread John Machin
[EMAIL PROTECTED] wrote: > > Not as concisely as a one-byte struct code > > Help, what do you mean? Help, what did you mean by the question? "struct" == "Python struct module" Struct module has (concise) codes B, H, I, Q for unsigned integers of lengths 1, 2, 4, 8, but does *not* have a code for

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> > > cdb0 = '\x08' '\x01\x23\x45' '\x80' '\0' > > > > cdb = '' > > cdb += struct.pack('>B', 0x08) > > cdb += struct.pack('>I', skip)[-3:] > > cdb += struct.pack('>BB', count, 0) > > The change from [-3:] to [1:] is a minor cosmetic improvement, Ouch, [1:] works while sizeof I is 4, yes, but that'

Re: Having problems with urlparser concatenation

2006-11-09 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, i80and wrote: > return self.open_local_file(url) > File "C:\Program Files\Python25\lib\urllib.py", line 465, in > open_local_file > raise IOError(e.errno, e.strerror, e.filename) > IOError: [Errno 2] The system cannot find the path specified: > 'en.wikipedia.org\\

Re: urlretrieve get file name

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 19:11, Sven wrote: I'm wrestling with the urlretrieve function in the urllib module. I want to download a file from a web server and save it locally with the same name. The problem is the URL - it's on the form http://www.page.com/?download=12345. It doesn't reveal the file

Re: how to create a multicolor "font-string" in pygame??

2006-11-09 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > [EMAIL PROTECTED] schrieb: >> Hi! I need to manipulate multicolor strings, i.e. strings with a color >> associated with each letter. >> Any suggestions? > > There is no support for multi-color strings as such in pygame. If you > use a fixed-width font, things are easy.

Tkinter check box behaviour - Windows / Linux discrepancy

2006-11-09 Thread peter
I've come across a weird difference between the behaviour of the Tkinter checkbox in Windows and Linux. The issue became apparent in some code I wrote to display an image in a fixed size canvas widget. If a checkbox was set then the image should be shrunk as necessary to fit the canvas while if cl

Having problems with urlparser concatenation

2006-11-09 Thread i80and
I'm working on a basic web spider, and I'm having problems with the urlparser. This is the effected function: -- def FindLinks(Website): WebsiteLen = len(Website)+1 CurrentLink = '' i = 0 SpliceStart = 0 SpliceEnd = 0

Re: pack a three byte int

2006-11-09 Thread p . lavarre
> Not as concisely as a one-byte struct code Help, what do you mean? > you presumably... read... the manual ... Did I reread the wrong parts? I see I could define a ctypes.Structure since 2.5, but that would be neither concise, nor since 2.3. > when 24-bit machines become ... popular Indeed t

Re: Simple question to split

2006-11-09 Thread John Machin
Matthias Winterland wrote: > Hi, > > I have a simple question. When I read in a string like: > a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a > single split-call? > Using str method split, no -- as documented [hint!], it provides only a single separator argument. Using re.

Re: Simple question to split

2006-11-09 Thread faulkner
def splits(seq, cs): if not cs: return seq elif isinstance(seq, str): return splits(seq.split(cs[0]), cs[1:]) else: return splits(sum([elem.split(cs[0]) for elem in seq], []), cs[1:]) or a = re.split('(\ |\,)', a) a.remove(' ') a.remove(',') Matthias Winterland wrote: > Hi, > > I have

Re: Simple question to split

2006-11-09 Thread Georg Brandl
Diez B. Roggisch schrieb: > Diez B. Roggisch schrieb: >> Matthias Winterland schrieb: >>> Hi, >>> >>> I have a simple question. When I read in a string like: >>> a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a >>> single split-call? >> >> Nope. But you could replace the com

Re: Simple question to split

2006-11-09 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: > Matthias Winterland schrieb: >> Hi, >> >> I have a simple question. When I read in a string like: >> a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a >> single split-call? > > Nope. But you could replace the commas with spaces, and then split. Or

Re: Simple question to split

2006-11-09 Thread Diez B. Roggisch
Matthias Winterland schrieb: > Hi, > > I have a simple question. When I read in a string like: > a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a > single split-call? Nope. But you could replace the commas with spaces, and then split. Diez -- http://mail.python.org/mailma

Re: Simple question to split

2006-11-09 Thread Dan Lenski
Yep, use regular expressions! For example, use the regular expression r',|\s+' to split on either (a) any amount of whitespace or (b) a single comma. Try this: import re a='1,2,3,4,5 6 7,3,4' print re.split(r',|\s+*', a) Matthias Winterland wrote: > Hi, > > I have a simple question. When I read

Re: Simple question to split

2006-11-09 Thread Robert Kern
Matthias Winterland wrote: > Hi, > > I have a simple question. When I read in a string like: > a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a > single split-call? You can't get what you want with a single method call. You can do it with a single call to .split() if you pr

Re: how to create a multicolor "font-string" in pygame??

2006-11-09 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hi! I need to manipulate multicolor strings, i.e. strings with a color > associated with each letter. > Any suggestions? There is no support for multi-color strings as such in pygame. If you use a fixed-width font, things are easy. Just create the strings one after a

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Dan Lenski
One other thing I'm wondering: how exactly does Tkinter work? Is the whole Tk toolkit bound up as library of low-level C code, or does Tkinter sit on top of a Tcl interpreter? If the latter, that might explain why it is frustratingly slow on Cygwin... since Cygwin is not very good at starting up

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Robin Becker
Andrew MacIntyre wrote: > Robin Becker wrote: > >> I think it uses sysv semaphores and although freeBSD 6 has them >> perhaps there's something I need to do to allow them to work. > > IIRC, you need to explicitly configure loading the kernel module, or > compile the kernel with the necessary opt

Simple question to split

2006-11-09 Thread Matthias Winterland
Hi, I have a simple question. When I read in a string like: a='1,2,3,4,5 6 7,3,4', can I get the list l=[1,2,3,4,5,6,7,3,4] with a single split-call? Thx, Matthias -- http://mail.python.org/mailman/listinfo/python-list

SPE bug?

2006-11-09 Thread timmy
i can't paste from SPE into an xterm window. is this problem with SPE? -- http://mail.python.org/mailman/listinfo/python-list

Re: how to create a multicolor "font-string" in pygame??

2006-11-09 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > Hi! I need to manipulate multicolor strings, i.e. strings with a color > associated with each letter. > Any suggestions? If you're on Unix / Linux the curses module might help. -- Jorge Godoy <[EMAIL PROTECTED]> -- http://mail.python.org/mailman/listinfo/python

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Robert Kern
Tim Chase wrote: > A few arbitrary warts per-dictum of BDFL are fine though...it > still looks much cleaner compared to PHP & Perl ;-) Well, it's neither arbitrary nor simply the preference of the BFDL. The ABC project actually did empirical experiments with programmers to find that code comprehe

urlretrieve get file name

2006-11-09 Thread Sven
Hi guys and gals, I'm wrestling with the urlretrieve function in the urllib module. I want to download a file from a web server and save it locally with the same name. The problem is the URL - it's on the form http://www.page.com/?download=12345. It doesn't reveal the file name. Some hints to poin

Re: ANN: PyQt v4.1 Released

2006-11-09 Thread Tool69
Sorry, I just tried with other lexers, but I'm having some errors (names not defined errors) with those ones : 1.lexer = QsciLexerRuby() 2.lexer = QsciLexerTeX() Are they implemented ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread Andrew MacIntyre
Robin Becker wrote: > I think it uses sysv semaphores and although freeBSD 6 has them perhaps > there's > something I need to do to allow them to work. IIRC, you need to explicitly configure loading the kernel module, or compile the kernel with the necessary option in the config file. --

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread John Henry
Steve Holden wrote: > > > You may find that it starts out fine, but becomes less satisfactory as > the sophistication of your interfaces increases. Then the problem will > be that migration to another platform demands a substantial rewrite of > your application (I have done this for a fairly sma

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Bjoern Schliessmann
Michael Hobbs wrote: > That is, assume that the expression ends at the colon, not at the > newline. That would make this type of statement possible: > if color == red or > color == blue or > color == green: > return 'primary' > Right now, such a statement would have to be s

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Bjoern Schliessmann
Dan Lenski wrote: > for my next project. I too would avoid Qt, not because of the GPL > but simply because I don't use KDE under Linux and because Qt is > not well supported under Cygwin or on native Windows. Why not? BTW, big projects such as the Opera browser use Qt. Also in Windows. Regard

Re: ANN: PyQt v4.1 Released

2006-11-09 Thread Tool69
Thanks David, your sample works nicely ! -- http://mail.python.org/mailman/listinfo/python-list

how to create a multicolor "font-string" in pygame??

2006-11-09 Thread Iacopo . Marmo
Hi! I need to manipulate multicolor strings, i.e. strings with a color associated with each letter. Any suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Vim/Python Help

2006-11-09 Thread Scott Smith
Thank you! Python Rocks! "Tim Chase" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> I am just getting into python and am trying to learn how to use the >> python.vim script. I really like the fact that it autoindents for me >> while inserting defs etc, but how do I move my cur

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Dan Lenski
Wojciech Mula wrote: > Nick Craig-Wood wrote: > >> It's very mature, full-featured, and portable, and fairly easy to > >> learn as well. > > > > ...with native look and feel on each platform unlike GTK / TK > > AFAIK Tk 8 uses platform's native widgets. > > w. Tk 8.4 appears to use native Win32

Re: [OT] Py3K idea: why not drop the colon?

2006-11-09 Thread [EMAIL PROTECTED]
Steve Holden wrote: > Paul Boddie wrote: > > Steve Holden wrote: > >> Paul Boddie wrote: > >>> http://www.python.org/doc/faq/general/#why-are-colons-required-for-the-if-while-def-class-statements > >>> > >> I suppose it would be even better if that hyperlink actually took you to > >> section 1.4.

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Steve Holden
Dan Lenski wrote: > John Henry wrote: >> I assume you meant that the example programs looks LabView-like GUIs? >> PythonCard itself has nothing in common with LabView. It's more like >> HyperCard. > > That's right, I'm saying the GUIs *produced* by PythonCard look like > those produced by LabVie

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Tim Chase
>>> Anyway, the FAQ answer seems to be a weak argument to me. >> I agree. I was expecting something more technical to justify >> the colon, not just that it looks better. > > I think it is outstanding that the colon's justification is > asthetic rather than technical (though I too had expected to

Re: Python memory usage

2006-11-09 Thread Klaas
placid wrote: > Actually i am executing that code snippet and creating BeautifulSoup > objects in the range() (now xrange() ) code block. Right; I was referring specifically to abominations like range(100), not looping over an incrementing integer. -Mike -- http://mail.python.org/mailman

Re: Exploiting Dual Core's with Py_NewInterpreter's separated GIL ?

2006-11-09 Thread robert
Paul Boddie wrote: > robert wrote: >> Shane Hathaway wrote: >>> of multiple cores. I think Python only needs a nice way to share a >>> relatively small set of objects using shared memory. POSH goes in that >>> direction, but I don't think it's simple enough yet. >>> >>> http://poshmodule.sourcefo

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread Neil Cerutti
On 2006-11-09, John Salerno <[EMAIL PROTECTED]> wrote: > Michael Hobbs wrote: >> Anyway, the FAQ answer seems to be a weak argument to me. > > I agree. I was expecting something more technical to justify > the colon, not just that it looks better. I think it is outstanding that the colon's justifi

Re: cross connecting

2006-11-09 Thread Gabriel Genellina
At Thursday 9/11/2006 17:17, km wrote: I have a c executable in machine A which cannot execute on B. I am on machine B and i need python program to connect to A via telnet and run the program with arguments passed from program on B and at the end fetch back results to machine B. i would lik

Re: UnboundLocalError

2006-11-09 Thread Rob Williscroft
Terry Reedy wrote in news:[EMAIL PROTECTED] in comp.lang.python: >> def main(): >>number = number() > > Within a function, a given name can be either global or local, but not > both. > Here you are expecting the compiler to interpret the first occurance > of 'number' as local and the second

Re: Lists of lists and tuples, and finding things within them

2006-11-09 Thread attn . steven . kuo
Daniel Nogradi wrote: > > I have a program that keeps some of its data in a list of tuples. > > Sometimes, I want to be able to find that data out of the list. Here is > > the list in question: > > > > [('password01', 'unk'), ('host', 'dragonstone.org'), ('port', '1234'), > > ('character01', 'Thes

cross connecting

2006-11-09 Thread km
HI all, I have a c executable in machine A which cannot execute on B. I am on machine B and i need python program to connect to A via telnet  and run the program with arguments passed from program on B  and at the end fetch back  results to machine B. i would like to know , which set of modules ar

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Dan Lenski
John Henry wrote: > I assume you meant that the example programs looks LabView-like GUIs? > PythonCard itself has nothing in common with LabView. It's more like > HyperCard. That's right, I'm saying the GUIs *produced* by PythonCard look like those produced by LabView. Believe me, if the Python

Re: Py3K idea: why not drop the colon?

2006-11-09 Thread John Salerno
Michael Hobbs wrote: > Anyway, the FAQ answer seems to be a > weak argument to me. I agree. I was expecting something more technical to justify the colon, not just that it looks better. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread John Henry
Dan Lenski wrote: > > John H.: thanks for pointing out pythoncard. This looks like it might > be an excellent substitute for LabView-like GUIs, which all my > coworkers like. I personally refuse to read or write LabView code, on > the grounds that its syntax causes severe brain damage and is > c

  1   2   3   >