Submitting change requests through correct channels (was: Why not just show the out-of-range index?)

2006-12-04 Thread Ben Finney
"Russ" <[EMAIL PROTECTED]> writes: > At this point I don't even plan to submit a formal request. I have too > many accounts and passwords already. If the implication here (that submitting a change request requires an account on the server) is true, then I must concur with Russ that it's a signifi

Re: how to invoke the shell command and then get the result in python

2006-12-04 Thread Fredrik Lundh
Bin Chen wrote: > I want to do following: get a user input regex, then pass this as a > parameter to grep, and then get the result from grep. > > Any code snip to implement the similar function? I am a python newbie. import os for line in os.popen("grep pattern *.txt"):

how to invoke the shell command and then get the result in python

2006-12-04 Thread Bin Chen
Hi, I want to do following: get a user input regex, then pass this as a parameter to grep, and then get the result from grep. Any code snip to implement the similar function? I am a python newbie. Thanks a lot. Bin -- http://mail.python.org/mailman/listinfo/python-list

Re: algorithm for sorting functional expressions

2006-12-04 Thread Fredrik Lundh
MRAB wrote: > It's left as an exercise for the reader as to how it works. :-) *if* it works, you mean. should the following script really print anything? import random, sys # input variables replaced with zeros L = [ ['b', ['w','z']], ['a', ['z','y']], ['w', ['z','0']], ['z

Re: Video stream server

2006-12-04 Thread Tim Roberts
"Lad" <[EMAIL PROTECTED]> wrote: > >The most important thing now is how to add a support for video files. This is not really a Python question -- it's an HTML question. You need to spend some time Googling for and tags which allow you shove a video as part of a web page. Then you can use your

Re: Why not just show the out-of-range index?

2006-12-04 Thread Hendrik van Rooyen
"Carsten Haese" <[EMAIL PROTECTED]> wrote: 8<- > My sarcasm meter just exploded. > > -Carsten Will you miss it a lot? - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: Python spam?

2006-12-04 Thread Hendrik van Rooyen
"Gabriel Genellina" <[EMAIL PROTECTED]> wrote: 8<-- So if a friend of yours has played the role of UserA above, that's how some spammers got your email address. + 1 for euphemism of the month... - Hendrik -- http://mail.python.org/mailman/listinfo/python-list

Re: How to compile omniORBpy on Windows?

2006-12-04 Thread Ravi Teja
[EMAIL PROTECTED] wrote: > How do I compile omniORBpy 3.0 on Windows? The readme.txt file seems > to talk only about how to do this on Unix. Unfortenuately, I can not > use the binary because I need to use Python 2.3.5. (and the binary > requires that I use Python 2.4). > > I tried to copy the o

Re: MySQL from python - dropping a database IF EXISTS

2006-12-04 Thread Fredrik Lundh
Ben wrote: > Ah well - I turned off warnings as a solution. Its a bit f a bodge, but > it works :-) according to the documentation, the database does generate a "note" when you do this: http://dev.mysql.com/doc/refman/5.0/en/drop-table.html and notes can be turned off independently of war

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
BJörn Lindqvist wrote: > Maybe so, but that doesn't mean that it is not possible to make the > IndexError messages Pythons sequence objects throws better. You don't > need to change the semantics of x[i]. are you claiming that the fact that you can change every single index check somehow prove t

Re: Why not just show the out-of-range index?

2006-12-04 Thread John Machin
OKB (not okblacke) wrote: > John Machin wrote: > > > 3. The OP asked only for values; you are asking for names and > > values. If you have a magic flak jacket, please let me know; I'd > > like to borrow it occasionally :-) > > On reflection I think my alternative suggestion might be just as >

Re: Why not just show the out-of-range index?

2006-12-04 Thread Russ
Folks, I'm truly sorry that so many feathers got ruffled in this thread. Let's see if I can put this thing to rest gracefully. Russ wrote: > My suggestion is trivial to implement and would benefit every Python > programmer (even if only slightly), so I don't think it is too much to > ask for. A

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
Russ wrote: >> you're forgetting that you're dealing with "squeaky wheel contributors" >> here, not the kind of nice and helpful persons that actually make open >> source work. > > Please refrain from dishing out gratutious insults until you have a > clue what you are talking about. It just so ha

Re: Async callback in python

2006-12-04 Thread Gabriel Genellina
At Tuesday 5/12/2006 01:18, Linan wrote: t=T('aVerySlowSite','/') asyncore.loop() for i in range(0,10): print '%d in main process' % i time.sleep(1) Suppose it's asynchronous, couple of '%d in main process' lines should be mixed in the output of T.handle_read(), right?

No module named _db2

2006-12-04 Thread jason . meiers
For some reason the _db2 module cannot be imported. Have you had this issue before? [EMAIL PROTECTED] python test_basic.py Traceback (most recent call last): File "test_basic.py", line 2, in ? import DB2 File "/home/itmuser/scripts/lib/PyDB2-1.1.0/test/DB2.py", line 10, in ? import _d

Re: Async callback in python

2006-12-04 Thread Felipe Almeida Lessa
On 4 Dec 2006 20:18:22 -0800, Linan <[EMAIL PROTECTED]> wrote: > 3, If not, where to get the real one(s)? After reading Calvin's mail, you may want to see http://twistedmatrix.com/ . It's an assynchronous library built around the concept of deferreds (think of callbacks). You may like it =). Cya,

Re: Async callback in python

2006-12-04 Thread Calvin Spealman
On 4 Dec 2006 20:18:22 -0800, Linan <[EMAIL PROTECTED]> wrote: > Hi, > > In javascript, code could be written like this: > > ... > > var _p=XMLHttpRequest(); > _p.open('GET',url,true); > _p.send(null); > _p.onreadystateChange=function(){ > if(_p.ready

Re: Why not just show the out-of-range index?

2006-12-04 Thread OKB (not okblacke)
John Machin wrote: > 3. The OP asked only for values; you are asking for names and > values. If you have a magic flak jacket, please let me know; I'd > like to borrow it occasionally :-) On reflection I think my alternative suggestion might be just as good: the interpreter could indicate

Cross-platform issue with wxRadioBox

2006-12-04 Thread gokhvat
I am experiencing a strange cross-platform issue with my python program. I am using wxRadioBox to create radio buttons. When I run the python code on a mac, everything works perfectly, but not on a pc. On the pc, no matter what selection I made, the form would think that I was choosing the 1st (to

Re: Video feature

2006-12-04 Thread Tim Roberts
"Lad" <[EMAIL PROTECTED]> wrote: > >Hello Tim, >Thank you for your reply. >Yes, my site uses Python. >Do you have any idea how to add video playing ( video streaming >feature)to my webiste? That's not the hard part. You can use an or tag to play a movie as part of a web site. Google is your fr

Re: Async callback in python

2006-12-04 Thread [EMAIL PROTECTED]
Did you flush the buffer? It might be that the print statements are being called in the order you expect but that they are all written to the screen only at the end. I've had that happen before. Cheers, -T Linan wrote: > Hi, > > In javascript, code could be written like this: > > ... > > v

Async callback in python

2006-12-04 Thread Linan
Hi, In javascript, code could be written like this: ... var _p=XMLHttpRequest(); _p.open('GET',url,true); _p.send(null); _p.onreadystateChange=function(){ if(_p.readyState==4) cb(_p.responseText); } ... This basic A

Filename too long error

2006-12-04 Thread Moqtar
I am trying to walk a directory and print the file and its modified time. When the path is longer then 259 characters i get an error "Filename too long". I guess these is because windows limitation on path length. My code: import os import time for root,dirs,files in os.walk(directory):

Re: Best way for inter-process communication in Python

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 21:41, Hugo Ferreira wrote: Please keep posting on the Python list. Thx for your reply. Are you able to point me out to some documentation over that process? The primary source is the Microsoft documentation http://msdn.microsoft.com/library/default.asp?url=/library/en-us/

Re: Why not just show the out-of-range index?

2006-12-04 Thread James Stroud
Russ wrote: > Fredrik Lundh wrote: > > >>>Sorry I haven't thought this through 100% >> >>obviously not. > > > > And you didn't like the "tone" of some of my earlier posts? > Some people consider themselves above a sensible conversation. James -- James Stroud UCLA-DOE Institute for Genomic

How to compile omniORBpy on Windows?

2006-12-04 Thread OlafMeding
How do I compile omniORBpy 3.0 on Windows? The readme.txt file seems to talk only about how to do this on Unix. Unfortenuately, I can not use the binary because I need to use Python 2.3.5. (and the binary requires that I use Python 2.4). I tried to copy the omniORBpy 3.0 source code to top\src\l

Re: sending string or list to a function

2006-12-04 Thread [EMAIL PROTECTED]
Or, just always send the function a list. If you have one string, send it a list containing that one string. Cheers, -T -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-04 Thread sturlamolden
Jon Harrop wrote: > So the super-fast BLAS routines are now iterating over the arrays many times > instead of once and the whole program is slower than a simple loop written > in C. Yes. And the biggest overhead is probably Python's function calls. Little is as efficient as well-written ISO C99

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread Justin Ezequiel
johnny wrote: > When I run the following script, with host and password and username > changed, I get the following errors: > raise error_temp, resp > error_temp: 421 Unable to set up secure anonymous FTP > > Dose the host should allow 4 simultaneous login at a time? > does it work using ftp.mic

Re: Monitoring number of smtp bytes sent through python e-mail socket

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 22:18, William Connery wrote: I want to give users an indication of the percentage of the e-mail that has already been sent so as to avoid frustration when dealing with large attachments or a slow smtp server. But the smtplib module doesn't seem to provide access to the numbe

Re: Monitoring number of smtp bytes sent through python e-mail socket

2006-12-04 Thread Jean-Paul Calderone
On Tue, 05 Dec 2006 12:18:08 +1100, William Connery <[EMAIL PROTECTED]> wrote: >Hi, > >I have a small python program with e-mail capabilities that I have >pieced together from code snippets found on the internet. > >The program uses the smtplib module to successfully send an e-mail with >an attachm

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > Robert Kern wrote: >> [EMAIL PROTECTED] wrote: >>> I saw no posts where there OP insulted anybody without being >>> insulted first. It is ironic the Mr. Kern was the most consistent >>> insulter while at the same time accusing the OP of rudeness. >> As I said, insult is

Re: python + database book

2006-12-04 Thread Peter Decker
On 12/4/06, Giuseppe Di Martino <[EMAIL PROTECTED]> wrote: > > new to python. > > i work with db heavily. > > > > any good book for python + database? > > Evaluate http://www.sqlalchemy.org/ and his documentation If you are looking to work with desktop apps, you should also check out Dabo: ht

Monitoring number of smtp bytes sent through python e-mail socket

2006-12-04 Thread William Connery
Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an e-mail with an attachment. I want to give users an indication of the percentage of the e-mail that has a

Re: SPE (Stani's Python Editor) web site?

2006-12-04 Thread Bernard
yes sir should I send them to you? John DeRosa a écrit : > On 28 Nov 2006 13:16:41 -0800, "Bernard" <[EMAIL PROTECTED]> > wrote: > > > > >I can send you the latest tar.gz ( SPE-0.8.3.c-wx2.6.1.0.tar ) file if > >you want it :) > > I'm looking for SPE for Python 2.5 and wxPython 2.7.2.0, on Window

Re: sending string or list to a function

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 21:20, manstey wrote: Is there a neat way to write a function that can receive either a string or a list of strings, and then if it receives a string it manipulates that, otherwise it manipulates each string in the list? That is, rather than having to send a list of one memb

Re: Why not just show the out-of-range index?

2006-12-04 Thread rurpy
Robert Kern wrote: > [EMAIL PROTECTED] wrote: > > I saw no posts where there OP insulted anybody without being > > insulted first. It is ironic the Mr. Kern was the most consistent > > insulter while at the same time accusing the OP of rudeness. > > As I said, insult is in the ear of the listener

Re: Why not just show the out-of-range index?

2006-12-04 Thread rurpy
Martin v. Löwis wrote: > [EMAIL PROTECTED] schrieb: > >>> Rather, they (like I) will encourage to OP to submit > >>> a patch that fixes the problem. > >> Now, that would be rather silly. I would have to familiarize > >> myself with the code for the Python interpreter, > > > > Seems to me he called

Re: decorators question

2006-12-04 Thread Carsten Haese
On Mon, 2006-12-04 at 23:44 +0100, Fredrik Lundh wrote: > Carsten Haese wrote: > > > * The function body gets compiled into byte code (but not executed). > > careful: when you get as far as executing the "def" statement, the > function body has already been compiled. the byte code for the funct

Re: mapped drive missing when run as a service

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 20:30, Thomas Thomas wrote: I have a python application which i run as a service.. import win32api,string drives=win32api.GetLogicalDriveStrings() drives=string.splitfields(drives,'\000') print drives in the list of drives my mapped network drive is not sho

Re: sending string or list to a function

2006-12-04 Thread Farshid Lashkari
manstey wrote: > Is there a neat way to write a function that can receive either a > string or a list of strings, and then if it receives a string it > manipulates that, otherwise it manipulates each string in the list? The following code shows one way you can accomplish this. I don't consider it

Re: Python spam?

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 16:27, John Draper wrote: I'm ALWAYS getting python spam but what worries me, is the spammers Know my personal home address, and I NEVER EVER fill out any forms pages with my personal info - I think I'm being harrassed by hackers or something... - UserA creates an accou

sending string or list to a function

2006-12-04 Thread manstey
Hi, Is there a neat way to write a function that can receive either a string or a list of strings, and then if it receives a string it manipulates that, otherwise it manipulates each string in the list? That is, rather than having to send a list of one member MyFunction(['var1']), I can send MyF

Re: Python-URL! - weekly Python news and links (Dec 4)

2006-12-04 Thread Terry Reedy
"Paul Boddie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >Python's "benevolent dictator" himself gave a talk recently, as >previously mentioned in Python-URL!, and Niall Kennedy summarises the >content for those not in attendance: > > http://www.niallkennedy.com/blog

Re: Why not just show the out-of-range index?

2006-12-04 Thread Russ
Fredrik Lundh wrote: > you're forgetting that you're dealing with "squeaky wheel contributors" > here, not the kind of nice and helpful persons that actually make open > source work. Please refrain from dishing out gratutious insults until you have a clue what you are talking about. It just so ha

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread johnny
When I run the following script, with host and password and username changed, I get the following errors: raise error_temp, resp error_temp: 421 Unable to set up secure anonymous FTP Dose the host should allow 4 simultaneous login at a time? Justin Ezequiel wrote: > import ftplib, posixpath, thre

Re: Best way for inter-process communication in Python

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 14:48, Hugo Ferreira wrote: There is another option that I thought while writing this... I can use the database for data communication. Like having a table with both in and out parameters. On the client-side, I fill the in parameters columns. Then I signal the external applic

Re: Best way for inter-process communication in Python

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 14:24, Hugo Ferreira wrote: The client-side of this program is a function in PostgreSQL. For the sake of simplicity, let's assume it is another program in Python that will be asking the resident one for results on-demand. Let's also assume that there will be dozens of concurr

Re: Why not just show the out-of-range index?

2006-12-04 Thread BJörn Lindqvist
On 12/4/06, Terry Reedy <[EMAIL PROTECTED]> wrote: > While Fredrik's reply is a bit short, as is sometimes his habit, > here are some things that appear to me to not have been thought through > enough: > 1. some negative indexes are legal. That could be fixed. Just substract len(L) from i if i < 0

mapped drive missing when run as a service

2006-12-04 Thread Thomas Thomas
Hi All, I have a python application which i run as a service.. import win32api,string drives=win32api.GetLogicalDriveStrings() drives=string.splitfields(drives,'\000') print drives in the list of drives my mapped network drive is not showing when i run the application as a ser

Re: MySQL from python - dropping a database IF EXISTS

2006-12-04 Thread Ben
Ah well - I turned off warnings as a solution. Its a bit f a bodge, but it works :-) Ben wrote: > Can someone explain why this might be happening: > > parser_beta.py:129: Warning: Can't drop database 'foobar'; database > doesn't exist > self.cursor.execute("DROP DATABASE IF EXISTS "+name) > >

Re: Why not just show the out-of-range index?

2006-12-04 Thread BJörn Lindqvist
On 12/4/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > BJörn Lindqvist wrote: > > >> > Sorry I haven't thought this through 100% > >> > >> obviously not. > > > > And you're not helping. > > I've already explained why something like PyObject_IsIndexOutOfBounds > cannot work earlier in this thread.

Re: Execution time of lines within a function

2006-12-04 Thread Paul McGuire
"monkeyboy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello, > > I have a function that hotshot says is very slow. I can get the > aggregate execution time, but is there a way to get the execution time > of each line so I can find the bottleneck? > > Thank you > The PythonDeco

Re: Factory pattern implementation in Python

2006-12-04 Thread Gabriel Genellina
At Monday 4/12/2006 13:39, [EMAIL PROTECTED] wrote: class Factory: def __isValidEventClass(self, obj): if inspect.isclass(obj) and obj != events.EvtBase and \ events.EvtBase in inspect.getmro(obj): for m in inspect.getmembers(obj): if m[0] == 'eventNum': ret

Re: Factory pattern implementation in Python

2006-12-04 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dennis Lee Bieber: >> Presuming the is a type code I'd just set up a list of >> functions: >> Then create a dictionary of them, keyed by the code >> processors = { "1" : process_1, >> "2" : process_2, >> >> "x" : process

Re: Convert PNG files to BMP files using PIL

2006-12-04 Thread Soni Bergraj
Craig wrote: > Can this be done using PIL or is there another library that can be used > to fulfil the task. If you could let me know that would be great. > Thanks and good luck. Not sure if this solves your particular problem, but have you considered ImageMagick? There are python bindings at htt

Re: algorithm for sorting functional expressions

2006-12-04 Thread MRAB
[EMAIL PROTECTED] wrote: > I am trying to write some code that will take a list of functional > expressions, and order them so that those with primitive terms appear > at the beginning of the list and those that are defined by other terms > appear last. > > eg: > getSortedEquations(['b

Re: Factory pattern implementation in Python

2006-12-04 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dennis Lee Bieber: >> Presuming the is a type code I'd just set up a list of >> functions: >> Then create a dictionary of them, keyed by the code >> processors = { "1" : process_1, >> "2" : process_2, >> >> "x" : proces

Re: Ensure a variable is divisible by 4

2006-12-04 Thread Jonathan Smith
> <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> I am sure this is a basic math issue, but is there a better way to >> ensure an int variable is divisible by 4 than by doing the following; >> >> x = 111 >> x = (x /4) * 4 >> >> Just seems a bit clunky to me. if ( x % 4 ) == 0:

Re: Ensure a variable is divisible by 4

2006-12-04 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I am sure this is a basic math issue, but is there a better way to > ensure an int variable is divisible by 4 than by doing the following; > > x = 111 > x = (x /4) * 4 > > Just seems a bit clunky to me. > All numbers are divisible by 4.

Re: decorators question

2006-12-04 Thread Fredrik Lundh
Carsten Haese wrote: > * The function body gets compiled into byte code (but not executed). careful: when you get as far as executing the "def" statement, the function body has already been compiled. the byte code for the function is stored as a module-level constant: >>> code = compile("def

Re: Interface Designer

2006-12-04 Thread Gabriel Genellina
At Sunday 3/12/2006 18:47, Murdok Petrovsky wrote: I'm starting to program in python, i need a soft "interface designer" and adapt this interface to python. Somebody can help me with this? Sorry, my english is very bad. Mine too. I don't understand what you want - what do you mean by "inter

MySQL from python - dropping a database IF EXISTS

2006-12-04 Thread Ben
Can someone explain why this might be happening: parser_beta.py:129: Warning: Can't drop database 'foobar'; database doesn't exist self.cursor.execute("DROP DATABASE IF EXISTS "+name) But the whole point about the "IF EXISTS" bit is (I thought) that it will only drop it if it exists, if it does

Re: Why not just show the out-of-range index?

2006-12-04 Thread Robert Kern
[EMAIL PROTECTED] wrote: > I saw no posts where there OP insulted anybody without being > insulted first. It is ironic the Mr. Kern was the most consistent > insulter while at the same time accusing the OP of rudeness. As I said, insult is in the ear of the listener, so I apologize if anyone cons

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
Martin v. Löwis wrote: > It would be unrealistic (but not silly) to suggest that > if the source code weren't available at all. It is *not* > silly to suggest that people should make efforts to > contribute to open source software. you're forgetting that you're dealing with "squeaky wheel contrib

Re: decorators question

2006-12-04 Thread Carsten Haese
On Mon, 2006-12-04 at 14:03 -0800, king kikapu wrote: > I recap: if i put only functions declarations on a .py file, like > these: > def A(): print "a" > def B(): print "b" > def C(): print "c" > > and run the program, nothing happens, nothing executed. Nothing *visible* happens. The "def" statem

Re: python + database book

2006-12-04 Thread Giuseppe Di Martino
Il Sat, 02 Dec 2006 21:00:05 -0800, progman ha scritto: > new to python. > i work with db heavily. > > any good book for python + database? Evaluate http://www.sqlalchemy.org/ and his documentation Giuseppe -- http://mail.python.org/mailman/listinfo/python-list

Re: WxPython

2006-12-04 Thread Gabriel Genellina
At Sunday 3/12/2006 09:14, Raja wrote: I am trying to develop an application which would mainly do the following 2 things . I would like to know how it can be achieved and also the libraries needed for it . i) active window tracking I'd use GetForegroundWindow+GetWindowText in a loop with

Re: decorators question

2006-12-04 Thread Fredrik Lundh
king kikapu wrote: > At first, i am coming from another (language) programming world (C# > mainly) and i hope you understand my wonders. > > Ok then, you tell me that the interpreter always execute the code in a > module...If there are only def declarations in the module and no code > to invoke t

Re: Why not just show the out-of-range index?

2006-12-04 Thread rurpy
Terry Reedy wrote: > "Russ" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > Fredrik Lundh wrote: > > > >> > Sorry I haven't thought this through 100% > >> > >> obviously not. > > > > And you didn't like the "tone" of some of my earlier posts? > > While Fredrik's reply is a bi

Opening colour BMPs with PIL

2006-12-04 Thread Craig
Hi there, I'm trying to open colour BMPs using PIL and I'm getting the following errors. Opening a 16 colour BMP I get: >>> im = Image.open("image.bmp") Traceback (most recent call last): File "", line 1, in im = Image.open("lightbulb2.bmp") File "C:\Python25\Lib\site-packages\PIL\Imag

Re: Multiple FTP download using Muliti thread

2006-12-04 Thread johnny
Where or What folder does the ftp files get downloaded to? Justin Ezequiel wrote: > import ftplib, posixpath, threading > from TaskQueue import TaskQueue > > def worker(tq): > while True: > host, e = tq.get() > > c = ftplib.FTP(host) > c.connect() > try: >

Re: Convert PNG files to BMP files using PIL

2006-12-04 Thread Fredrik Lundh
Craig wrote: > I'm trying to convert some PNG files to bitmap files which can then be > converted to X11 bitmaps using the im.tobitmap() function. But the > error I get when using the im.tobitmap() function on the PNG files I > get the following error: > im.tobitmap() tobitmap() only works

Re: Why not just show the out-of-range index?

2006-12-04 Thread Martin v. Löwis
[EMAIL PROTECTED] schrieb: >>> Rather, they (like I) will encourage to OP to submit >>> a patch that fixes the problem. >> Now, that would be rather silly. I would have to familiarize >> myself with the code for the Python interpreter, > > Seems to me he called the suggestion (made without any > k

Convert PNG files to BMP files using PIL

2006-12-04 Thread Craig
Hi there, I'm trying to convert some PNG files to bitmap files which can then be converted to X11 bitmaps using the im.tobitmap() function. But the error I get when using the im.tobitmap() function on the PNG files I get the following error: >>> im.tobitmap() Traceback (most recent call last):

Re: decorators question

2006-12-04 Thread king kikapu
At first, i am coming from another (language) programming world (C# mainly) and i hope you understand my wonders. Ok then, you tell me that the interpreter always execute the code in a module...If there are only def declarations in the module and no code to invoke them it does not execute anythin

Re: python Noob - basic setup question / problem

2006-12-04 Thread Bjoern Schliessmann
Lilavivat wrote: > /usr/bin/python2: bad interpreter: No such file or directory > > "which python" gives me "/usr/local/bin/python" > > "which python2.4" gives me "/usr/local/bin/python2.4" > > But /usr/bin/python is symlinked to python2.4 "python -> > python2.4" Try to understand what "which"

Re: Inheritance doesn't work

2006-12-04 Thread Fredrik Lundh
J. Clifford Dyer wrote: > Sure, but I think the question was more about how code that references > "MandelbrotImage could yield a stack that references MandelImage. well, it's been obvious for quite some time that we've now reached a point in Python's quest for world domination where newbies sta

Re: Thread error

2006-12-04 Thread Salvatore Di Fazio
Hi Dennis, I have another little problem with your source: Traceback (most recent call last): File "main.py", line 86, in kdi.join() # wait for kdi thread to exit NO CPU HOG BUSY LOOPS File "d:\programmi\python25\lib\threading.py", line 549, in join assert self.__started, "cannot joi

Re: Why not just show the out-of-range index?

2006-12-04 Thread Terry Reedy
"Russ" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Fredrik Lundh wrote: > >> > Sorry I haven't thought this through 100% >> >> obviously not. > > And you didn't like the "tone" of some of my earlier posts? While Fredrik's reply is a bit short, as is sometimes his habit, here

Re: About alternatives to Matlab

2006-12-04 Thread Carl Banks
sturlamolden wrote: > Carl Banks wrote: > > > > Ok. Perhaps starting a Python JIT in something like MetaOCaml or > > > Lisp/Scheme > > > would be a good student project? > > > > ...and finishing would be a good project for a well-funded team of > > experienced engineers. > > I think this is a good

Re: Why not just show the out-of-range index?

2006-12-04 Thread John Machin
OKB (not okblacke) wrote: [snip] > I think the same could be said of virtually all exceptions. What I > think would be ideal is that whenever an exception is raised, the > traceback tells you: > > 1) What the exception is > 2) The names of the variables involved in the offending

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
BJörn Lindqvist wrote: >> > Sorry I haven't thought this through 100% >> >> obviously not. > > And you're not helping. I've already explained why something like PyObject_IsIndexOutOfBounds cannot work earlier in this thread. -- http://mail.python.org/mailman/listinfo/python-list

Re: About alternatives to Matlab

2006-12-04 Thread Jon Harrop
sturlamolden wrote: > I don't agree that slicing is not the best way to approach this > problem. Indeed, the C++ approach can be written very succinctly using slicing: for i=0 to n/2-1 do tmp[i] = dot a[2*i:] h; tmp[i + n/2] = dot a[2*i + 1:] g; where a[i:] denotes the array starting at inde

Re: Why not just show the out-of-range index?

2006-12-04 Thread BJörn Lindqvist
On 12/4/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: BJörn Lindqvist wrote: > Sorry I haven't thought this through 100% obviously not. And you're not helping. Anyway, here's the patch: Index: Objects/listobject.c === --- Objects

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
Russ wrote: > And you didn't like the "tone" of some of my earlier posts? http://sourceforge.net/tracker/?group_id=5470&atid=355470 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why not just show the out-of-range index?

2006-12-04 Thread Russ
Fredrik Lundh wrote: > > Sorry I haven't thought this through 100% > > obviously not. And you didn't like the "tone" of some of my earlier posts? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python bindings for RCS apps

2006-12-04 Thread [EMAIL PROTECTED]
I want some RCS for document management which could be controlled by python :) a bit like a wiki. -- http://mail.python.org/mailman/listinfo/python-list

Re: Factory pattern implementation in Python

2006-12-04 Thread bearophileHUGS
Dennis Lee Bieber: > Presuming the is a type code I'd just set up a list of functions: > Then create a dictionary of them, keyed by the code > processors = { "1" : process_1, > "2" : process_2, > > "x" : process_x } Jus

Re: Inheritance doesn't work

2006-12-04 Thread John Salerno
J. Clifford Dyer wrote: > Sure, but I think the question was more about how code that references > "MandelbrotImage could yield a stack that references MandelImage. Yeah, I guess I could have been more specific. :) -- http://mail.python.org/mailman/listinfo/python-list

Python-URL! - weekly Python news and links (Dec 4)

2006-12-04 Thread Paul Boddie
QOTW: "We of all people should understand Worse Is Better. And I forgot to mention a little flash in the pan called Python, for which Tkinter (2+2 left as an exercise) is the GUI of choice." - Ken Tilton (on comp.lang.lisp, perhaps stretching the meaning of "of choice" somewhat) http://groups.

Re: Why not just show the out-of-range index?

2006-12-04 Thread Fredrik Lundh
BJörn Lindqvist wrote: > Sorry I haven't thought this through 100% obviously not. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python spam?

2006-12-04 Thread John Draper
Hendrik van Rooyen wrote: >"Aahz" <[EMAIL PROTECTED]> wrote: > > > >>Anyone else getting "Python-related" spam? So far, I've seen messages >>"from" Barry Warsaw and Skip Montanaro (although of course header >>analysis proves they didn't send it). >>-- >> >> > >not like that - just the norma

Re: Why not just show the out-of-range index?

2006-12-04 Thread BJörn Lindqvist
On 12/4/06, OKB (not okblacke) <[EMAIL PROTECTED]> wrote: > I think the same could be said of virtually all exceptions. What I > think would be ideal is that whenever an exception is raised, the > traceback tells you: > > 1) What the exception is > 2) The names of the varia

Re: Python bindings for RCS apps

2006-12-04 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > There is pySVN for subversion but does other revision control system > systems have some good python bindings/apis ? with good docs and some > examples. Here are some starting points for some different systems: Bazaar -- Something about the structure of bzrlib: htt

Re: Why not just show the out-of-range index?

2006-12-04 Thread BJörn Lindqvist
On 12/4/06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Russ schrieb: > > I love Python, but every time I get an out-of-range error message, I > > wonder why it didn't just tell me what the out-of-range index was and > > what the allowable range was. Certainly that information must be > > availa

Re: decorators question

2006-12-04 Thread Soni Bergraj
There was a copy-and-paste error with my last message. Better try this for foobar.py: def foo(f): print "called foo" return 'some text' @foo def bar(): print "called bar" -- Soni Bergraj http://www.YouJoy.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators question

2006-12-04 Thread Soni Bergraj
> Shouldn't this code called when we actually DO call it ? Python statements are always executed to create the corresponding class and function objects when a module is imported. Cheers, -- Soni Bergraj http://www.YouJoy.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: decorators question

2006-12-04 Thread Fredrik Lundh
king kikapu wrote: > Hmmm...ok...it calls the decorator but when ?? It (the runtime) loads > the .py file and start to call every decorator you seem to be missing that the interpreter *always* executes the code in a module to find out what it contains. "def" and "class" are exe- cutable statem

Re: decorators question

2006-12-04 Thread Soni Bergraj
> Hmmm...ok...it calls the decorator but when ?? It (the runtime) loads > the .py file and start to call every decorator > it finds on it, regardless of the existance of code that actually calls > the decorated functions ?? > I understand thet Python does not call the decoratated functiond but it >

  1   2   >