Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Kevin Walzer
Michael Bentley wrote: > OK. In order to kill the-thread-that-would-not-die(tm), I think I know > what I must do. I'll print a correction: > > On Apr 19, 2007, at 2:22 AM, Michael Bentley wrote: >> ... I switched to PyObjC. The >> learning curve is rather steep IMO, but worth it. One thing I

Tutorial creates confusion about slices

2007-04-23 Thread Antoon Pardon
The following is part of the explanation on slices in the tutorial: The best way to remember how slices work is to think of the indices as pointing between characters, with the left edge of the first character numbered 0. Then the right edge of the last character of a string of n characters has in

[SQLite] Recommended wrapper?

2007-04-23 Thread Gilles Ganault
Hello I browsed through the SQLite archives at Gname, but most threads regarding wrappers for Python date back to 2005, and for this ng, Google returns stuff from 2006 as the most relevant posts, so I figured I should ask here before diving in. There are several wrappers listed in the wik

Re: TK-grid problem, please help

2007-04-23 Thread Hertha Steck
Hello, Ray schrieb: > Hi, Thanks for the help. > > > I was trying to find a book "Python TK" something on last Friday. > but didn't find it :-) > There is only one printed book, all the details here: http://wiki.python.org/moin/GuiBooks HTH Hertha -- http://mail.python.org/mailman/listinfo/

Re: Tutorial creates confusion about slices

2007-04-23 Thread Antoon Pardon
On 2007-04-23, Rob Wolfe <[EMAIL PROTECTED]> wrote: > > Antoon Pardon wrote: >> The following is part of the explanation on slices in the >> tutorial: >> >> The best way to remember how slices work is to think of the indices as >> pointing between characters, with the left edge of the first charact

Re: Shebang or Hashbang for modules or not?

2007-04-23 Thread Steven W. Orr
On Saturday, Apr 21st 2007 at 19:18 +0100, quoth Michael Hoffman: =>Chris Lasher wrote: =>> Should a Python module not intended to be executed have shebang/ =>> hashbang (e.g., "#!/usr/bin/env python") or not? I'm used to having a =>> shebang in every .py file but I recently heard someone argue th

Re: Tutorial creates confusion about slices

2007-04-23 Thread Rob Wolfe
Antoon Pardon wrote: > The following is part of the explanation on slices in the > tutorial: > > The best way to remember how slices work is to think of the indices as > pointing between characters, with the left edge of the first character > numbered 0. Then the right edge of the last character o

Re: redirect ouput

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 09:29:40 -0300, <[EMAIL PROTECTED]> escribió: >I am working on parsing an xml file using python.How can i > redirect the output to 2 files,say,for some portion of code the output > has to go to one file and for some part the o/p be directed to another > file. Using two

redirect ouput

2007-04-23 Thread saif . shakeel
Hi, I am working on parsing an xml file using python.How can i redirect the output to 2 files,say,for some portion of code the output has to go to one file and for some part the o/p be directed to another file. -- http://mail.python.org/mailman/listinfo/python-list

Re: send pictures to mobile phones - sms767

2007-04-23 Thread Steve Holden
sms767 wrote: > Hi, > > Is there anyone interested in helping test a web service? Sending > pictures to mobile phones: > > http://www.sms767.com > Probably those list readers who are interested in having their names and cellphone numbers captured and potentially spammed to hell, as if that kin

Re: Python and Javascript equivalence

2007-04-23 Thread Steve Holden
Sam the Cat wrote: > Hey All, > > I am writing some COM code in Python to control photoshop. Several > functions of PS require an "Array" argument. In the examples of VBscript or > javascript the Array type is used. I have tried what would appear to be the > equivalent in Python -- Lists and

Re: matplotlib basic question

2007-04-23 Thread Pete Forman
Robert Kern <[EMAIL PROTECTED]> writes: > Colin J. Williams wrote: > >> I'm not sure that scipy has been updated to Python 2.5 > > ? scipy certainly works with 2.5. Are you referring to something > else perhaps? Yes, the Python Enthought Edition was being discussed and it is currently based on

Re: Two syntax questions (newbie)

2007-04-23 Thread Duncan Booth
Szabolcs <[EMAIL PROTECTED]> wrote: > In Python this would be something like > result = processData(list(reversed(sorted(data I know that is only intended as an example, but by trying to use Mathematica idioms in Python you are perhaps blinding yourself to using Python's own idioms. A more

Re: TK-grid problem, please help

2007-04-23 Thread Ray
Hi, Thanks for the help. I was trying to find a book "Python TK" something on last Friday. but didn't find it :-) I know those codes are in poor design, because I wrote those sample code to show the idea about what I need. the real code is working with mysql. however, I'm really new in python.

Re: TK-grid problem, please help

2007-04-23 Thread Ray
Hi, Thanks for the help! Anton Vredegoor wrote: > Ray wrote: > >> hi, I have a question about how to use .grid_forget (in python/TK) >> >> I need to work on grid repeatly. everytime when a button is pressed, >> the rows of grid is different. such like, first time, it generate 10 >> rows of data

Re: Select weirdness

2007-04-23 Thread Jean-Paul Calderone
On Mon, 23 Apr 2007 00:33:22 -0700, Ron Garret <[EMAIL PROTECTED]> wrote: >In article <[EMAIL PROTECTED]>, > Irmen de Jong <[EMAIL PROTECTED]> wrote: > >> Ron Garret wrote: >> > I don't understand why socketserver calling select should matter. (And >> > BTW, there are no calls to select in SocketS

Re: [ANN] Pythonutils 0.3.0

2007-04-23 Thread Colin J. Williams
Fuzzyman wrote: > There is a new (and long overdue) release of the `Pythonutils module > `_. > This is version **0.3.0**. > > * `Quick Download: Pythonutils 0.3.0.zip cgi-bin/voidspace/downman.py?file=pyt

The Hack of bitmask used as Predicate Parameters

2007-04-23 Thread Xah Lee
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function that can draw a rainbow, and each color of the rainbow can be turned on or off individually. My functio

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Michael Bentley
OK. In order to kill the-thread-that-would-not-die(tm), I think I know what I must do. I'll print a correction: On Apr 19, 2007, at 2:22 AM, Michael Bentley wrote: > ... I switched to PyObjC. The > learning curve is rather steep IMO, but worth it. One thing I think > I should mention though

Offer of free dedicated servers for the Python project

2007-04-23 Thread Jasper Bryant-Greene
Hi All Please don't interpret this as spam or as a posting of a commercial nature. I am here to point out an opportunity for the Python project to receive some free hardware support. I'm not here to sell anything :) My company, DirectScale, is offering 10 free dedicated servers to open-source pro

Re: recursion depth problem

2007-04-23 Thread Michael Bentley
On Apr 23, 2007, at 1:57 AM, proctor wrote: > On Apr 22, 5:51 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: >> Oops! Note to self: *ALWAYS* try code before posting to a public >> forum :-( >> >> def binary(val, width): >> print '%10s = the sum of' % val >> for i in [2 ** x for x

Re: Two syntax questions (newbie)

2007-04-23 Thread Diez B. Roggisch
> This is already better. Is it possible to define function composition > as an operator and have something like ([EMAIL PROTECTED]@sorted)(items) > or (list*reversed*sorted)(items) ? Not on functions, but on classes/instances. So something like this might work for you (untested): class FunctionC

Re: ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread 人言落日是天涯,望极天涯不见家
On Apr 23, 5:42 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > 人言落日是天涯,望极天涯不见家 wrote: > > first, I'm try the POINTER to convesion the pointer type. but failed. > > > class STUDENT(Structure): > >     _fields_ = [('name',  c_int), > >                     ('id',   c_int), > >                    

Re: ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread Diez B. Roggisch
人言落日是天涯,望极天涯不见家 wrote: > first, I'm try the POINTER to convesion the pointer type. but failed. > > class STUDENT(Structure): > _fields_ = [('name', c_int), > ('id', c_int), > ('addition',c_ubyte)] > > buffer = c_byte * 1024 > student_p = cast(bu

Re: When are immutable tuples *essential*? Why can't you just use lists *everywhere* instead?

2007-04-23 Thread Antoon Pardon
On 2007-04-20, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Fri, 20 Apr 2007 15:28:51 -0300, Bjoern Schliessmann ><[EMAIL PROTECTED]> escribió: > >> Luis M. González wrote: >> >>> I don't remember exactly where I read about it, but Guido said >>> once that tuples are being kept mainly for hi

Re: Support for new items in set type

2007-04-23 Thread Prateek
> I don't see where your SeaSet class is used. > Actually that is the point. According to the hotshot profile, the problem code doesn't use the SeaSet implementation. Yet that same code was running much faster earlier. I tried multiple time (2-3 times). >From what I can fathom, nothing else changed

Re: Two syntax questions (newbie)

2007-04-23 Thread Szabolcs
Thanks for the reply! On Apr 23, 10:55 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > or define a > > function composition operator for functions that take a single > > argument? > > You could use this: > > def chain(*args): >"""Compose functions (assoc right). >last argument (args

Re: *** Dr G Polya BRILLIANTLY analyses the Virgina Shooting Incident ***

2007-04-23 Thread The Real Andy
On 22 Apr 2007 17:17:40 -0700, [EMAIL PROTECTED] wrote: >On Apr 22, 8:49 pm, Jim Thompson <[EMAIL PROTECTED] >Web-Site.com> wrote: >> Ignorant Bastard Poster >> >> On 22 Apr 2007 11:32:34 -0700, [EMAIL PROTECTED] wrote: >> >> >Dr Gideon Polya published some 130 works in a 4 decade scientific >> >c

Re: Two syntax questions (newbie)

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 05:15:26 -0300, Szabolcs <[EMAIL PROTECTED]> escribió: > Mathematica allows writing > result = [EMAIL PROTECTED]@[EMAIL PROTECTED] > or even > result = data//Sort//Reverse//processData > instead of > result = processData[Reverse[Sort[data]]] > > In Python this would be somethin

Re: serializable object references

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 03:35:42 -0300, Martin Drautzburg <[EMAIL PROTECTED]> escribió: > Gabriel Genellina wrote: > >> En Sun, 22 Apr 2007 12:47:10 -0300, Martin Drautzburg >> <[EMAIL PROTECTED]> escribió: >> >>> I was thinking that it would be nice if a web application could talk >>> to real objec

ctypes: how to make a structure pointer to point to a buffer

2007-04-23 Thread 人言落日是天涯,望极天涯不见家
first, I'm try the POINTER to convesion the pointer type. but failed. class STUDENT(Structure): _fields_ = [('name', c_int), ('id', c_int), ('addition',c_ubyte)] buffer = c_byte * 1024 student_p = cast(buffer, POINTER(STUDENT)) The parameter of

Re: Dictionaries and dot notation

2007-04-23 Thread Antoon Pardon
On 2007-04-22, Martin Drautzburg <[EMAIL PROTECTED]> wrote: > Daniel Nogradi wrote: > > >>> > What if I want to create a datastructure that can be used in dot >>> > notation without having to create a class, i.e. because those >>> > objects have no behavior at all? >>> >>> A class inheriting from d

Two syntax questions (newbie)

2007-04-23 Thread Szabolcs
I used Mathematica for data processing a lot and I got spoiled by its functional programming possibilities. I was drawn to Python because it also allows for a similar programming style (and, more importantly, it has an interactive shell, ipython, and a lot of libraries that are useful to me, like

Re: python cgi problem with textarea

2007-04-23 Thread Peter Otten
Adrian Smith wrote: > ...and I get an internal server error if I have any spaces in the > textarea, which is really going to limit its usefulness to me. Oddly, While debugging you should put > #!/usr/bin/python import cgitb cgitb.enable() > import cgi > print "Content-type: text/html\n"

Re: python cgi problem with textarea

2007-04-23 Thread placid
On Apr 23, 1:01 am, Adrian Smith <[EMAIL PROTECTED]> wrote: > On Apr 22, 10:09 pm, placid <[EMAIL PROTECTED]> wrote: > > > i just tried it and its working. here it is > > >http://yallara.cs.rmit.edu.au/~bevcimen/form.html > > > maybe the internal server error is because mod_python isn't installed >

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Antoon Pardon
On 2007-04-20, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On 20 Apr 2007 12:25:40 GMT, Antoon Pardon <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> >> But if a wrong idea is circulating and nobody ever tries to correct it, >> people will continue with the wrong idea. A

Re: Dictionaries and dot notation

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 03:14:32 -0300, Martin Drautzburg <[EMAIL PROTECTED]> escribió: > I did not notice that I can use a single class (or a module) for > all my datastructures, because I can "plug in" new attributes into the > instance without the class knowing about them. > > I was mistaken to b

Re: Select weirdness

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 04:33:22 -0300, Ron Garret <[EMAIL PROTECTED]> escribió: > I have not been able to find a proxy server that can proxy to unix > sockets, so I need to write my own. Conceptually its a very simple > thing: read the first line of an HTTP request, parse it with a regexp to > ext

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Antoon Pardon
On 2007-04-22, René Fleschenberg <[EMAIL PROTECTED]> wrote: > Antoon Pardon schrieb: >>> Who says the axes are labeled "familiarity" and "learning period"? I >>> just assume they are labeled (y-axis) "Effort" and (x-axis) "Knowledge" >>> (or "skill" or ). >> >> You can assume all you want,

Re: Python and Javascript equivalence

2007-04-23 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Prateek wrote: > Try creating a dict with sequential numeric keys. > > If you already have a list called my_list, you can do: > > com_array = dict(zip(range(len(my_list)), my_list)) com_array = dict(enumerate(my_list)) That doesn't create the intermediate lists. Ciao,

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Antoon Pardon
On 2007-04-21, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > Antoon Pardon schrieb: >> On 2007-04-20, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: So if you have the choice between a steep or a shalow income curve you will prefer the shalow curve because a steep curve makes you think

Re: Select weirdness

2007-04-23 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Irmen de Jong <[EMAIL PROTECTED]> wrote: > Ron Garret wrote: > > I don't understand why socketserver calling select should matter. (And > > BTW, there are no calls to select in SocketServer.py. I'm using > > Python2.5.) > > You don't *need* a select at all. Y

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Antoon Pardon
On 2007-04-20, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 20 Apr, 16:34, Antoon Pardon <[EMAIL PROTECTED]> wrote: >> On 2007-04-20, Paul Boddie <[EMAIL PROTECTED]> wrote: >> >> > You could have knowledge or accomplishment >> > on the X axis and effort or work on the Y axis. >> >> What else is effo

Re: Support for new items in set type

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 02:17:49 -0300, Prateek <[EMAIL PROTECTED]> escribió: > Oh dear god, I implemented this and it overall killed performance by > about 50% - 100%. The same script (entering 3000 items) takes between > 88 - 109s (it was running in 55s earlier). > > Here is the new Set implementati

send pictures to mobile phones - sms767

2007-04-23 Thread sms767
Hi, Is there anyone interested in helping test a web service? Sending pictures to mobile phones: http://www.sms767.com Thanks, Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: recursion depth problem

2007-04-23 Thread proctor
On Apr 22, 5:51 pm, Michael Bentley <[EMAIL PROTECTED]> wrote: > Oops! Note to self: *ALWAYS* try code before posting to a public > forum :-( > > def binary(val, width): > print '%10s = the sum of' % val > for i in [2 ** x for x in range(width - 1, -1, -1)]: > a = v

<    1   2