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

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: 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

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: 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-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: 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-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: 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: 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: 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: 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: 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"

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: 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

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: 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

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: *** 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 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: 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: 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: 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: 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: 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: 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

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: 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

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: [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

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: 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: 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: 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: 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: 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: 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

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: 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

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: 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 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: 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/

[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

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

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

Re: [SQLite] Recommended wrapper?

2007-04-23 Thread Thomas Krüger
It's all there: http://docs.python.org/lib/module-sqlite3.html Thomas -- sinature: http://nospam.nowire.org/signature_usenet.png -- http://mail.python.org/mailman/listinfo/python-list

Re: Tutorial creates confusion about slices

2007-04-23 Thread Michael Bentley
On Apr 23, 2007, at 7:38 AM, 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 righ

Re: Can __init__ not return an object?

2007-04-23 Thread Steve Holden
Steven W. Orr wrote: > On Sunday, Apr 22nd 2007 at 21:01 -0400, quoth Steve Holden: [let's keep it on the list so everything gets indexed] > =>Steven W. Orr wrote: > =>> When I go to create an object I want to be able to decide whether the > =>> object is valid or not in __init__, and if not, I wa

RE: Tutorial creates confusion about slices

2007-04-23 Thread Hamilton, William
> -Original Message- > From: [EMAIL PROTECTED] [mailto:python- > [EMAIL PROTECTED] On Behalf Of Antoon Pardon > Sent: Monday, April 23, 2007 7:38 AM > To: python-list@python.org > Subject: Tutorial creates confusion about slices > > The following is part of the explanation on slices in the

Re: Do other Python GUI toolkits require this?

2007-04-23 Thread Diez B. Roggisch
> I had originally thought that learning PyObjC might preclude me from > having to learn Objective-C, but that seems not to be the case. I have > previously found the same to be true with PyQt and wxPython--not knowing > the toolkits as they are implemented in C++ is a serious handicap. I've > even

Re: [re.finditer] Getting all occurences in one go?

2007-04-23 Thread Gilles Ganault
On 22 Apr 2007 15:33:37 -0700, Paul Rubin wrote: > mytable[item] = ','.join(m.group(1) for m in matches) Thanks, that did it. -- http://mail.python.org/mailman/listinfo/python-list

Re: [SQLite] Recommended wrapper?

2007-04-23 Thread Gilles Ganault
On Mon, 23 Apr 2007 16:03:05 +0200, Thomas Krüger <[EMAIL PROTECTED]> wrote: >It's all there: >http://docs.python.org/lib/module-sqlite3.html Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Learning Python - First Project

2007-04-23 Thread KDawg44
Hi, I am new to Python and am trying to write a little front end to another application in Python. What I want is to have a gui pop up listing some items with several buttons. The guts of the program I am not having any trouble with but the GUI part I am (or more accurately, the transition betwe

Re: python style guide inconsistencies

2007-04-23 Thread Darren Dale
Bjoern Schliessmann wrote: > Darren Dale wrote: > >> I was just searching for some guidance on how to name packages and >> modules, and discovered some inconsistencies on the >> www.python.org. http://www.python.org/doc/essays/styleguide.html >> says "Module names can be either MixedCase or lower

Re: Two syntax questions (newbie)

2007-04-23 Thread Michael Hoffman
Diez B. Roggisch wrote: >> 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

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

2007-04-23 Thread Neil Cerutti
On 2007-04-21, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Fri, 20 Apr 2007 15:36:00 -0700, [EMAIL PROTECTED] wrote: >>> The article explains that, amongst other things, tuples are >>> faster than lists, so if you are working with constant values >>> (inmutables) they are more indicated than li

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

2007-04-23 Thread Chris Cioffi
On 23 Apr 2007 17:19:15 +0200, Neil Cerutti <[EMAIL PROTECTED]> wrote: > So the question becomes: Why do Python dictionaries require keys > to be of an immutable type? Dictionary keys are hashed values. If you change the key, you change the hash and lose the pointer to the referenced object. Or:

Re: python style guide inconsistencies

2007-04-23 Thread Paddy
On Apr 22, 8:27 pm, Darren Dale <[EMAIL PROTECTED]> wrote: > I was just searching for some guidance on how to name packages and modules, > and discovered some inconsistencies on > thewww.python.org.http://www.python.org/doc/essays/styleguide.htmlsays > "Module names can be > either MixedCase or l

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

2007-04-23 Thread Neil Cerutti
On 2007-04-23, Chris Cioffi <[EMAIL PROTECTED]> wrote: > On 23 Apr 2007 17:19:15 +0200, Neil Cerutti <[EMAIL PROTECTED]> > wrote: >> So the question becomes: Why do Python dictionaries require >> keys to be of an immutable type? > > Dictionary keys are hashed values. If you change the key, you > c

numpy migration (also posted to numpy-discussion)

2007-04-23 Thread Duncan Smith
Hello, Since moving to numpy I've had a few problems with my existing code. It basically revolves around the numpy scalar types. e.g. >>> import Numeric as N >>> a = N.array([[0,1],[2,3]]) >>> a array([[0, 1], [2, 3]]) >>> i = a[0,0] >>

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

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 12:46:13 -0300, Neil Cerutti <[EMAIL PROTECTED]> escribió: > On 2007-04-23, Chris Cioffi <[EMAIL PROTECTED]> wrote: >> On 23 Apr 2007 17:19:15 +0200, Neil Cerutti <[EMAIL PROTECTED]> >> wrote: >>> So the question becomes: Why do Python dictionaries require >>> keys to be of a

Python-URL! - weekly Python news and links (Apr 23)

2007-04-23 Thread Cameron Laird
QOTW: "The users." - Ali, answering a question on what's special about Emacs. "Dynamic languages look at WSDL and shrug - another example of the hoops that static typing forces humans to go through." - Gordon Weakliem http://lists.community.tummy.com/pipermail/frpythoneers/2007-April/001342.

Redirection problem

2007-04-23 Thread CSUIDL PROGRAMMEr
I am new to python. so be patient with me I am trying to redirect the output of os.popen command to a file. I want to append to that file. but instead of appending. The file only shows last command that was writtenn to it. filehandle= open("/root/yhpc-2.0/installer/yhpc-log" ,"a+"); fileh

Re: Can __init__ not return an object?

2007-04-23 Thread Kay Schluehr
On Apr 22, 4:36 am, "Steven W. Orr" <[EMAIL PROTECTED]> wrote: > When I go to create an object I want to be able to decide whether the > object is valid or not in __init__, and if not, I want the constructor to > return something other than an object, (like maybe None). I seem to be > having proble

Generate report containing pdf or ps figures?

2007-04-23 Thread Grant Edwards
I need to be able to generate a PDF report which consists mostly of vector images (which I can generate as encapsulated Postscript, PDF, or SVG). What I need is a way to combine these figures into a single PDF document. Right now the reports consist entire of these figures, so I just write the fi

Re: Shebang or Hashbang for modules or not?

2007-04-23 Thread Michael Hoffman
Steven W. Orr wrote: > 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

Re: python style guide inconsistencies

2007-04-23 Thread Michael Hoffman
Darren Dale wrote: > Bjoern Schliessmann wrote: > >> Darren Dale wrote: >> >>> I was just searching for some guidance on how to name packages and >>> modules, and discovered some inconsistencies on the >>> www.python.org. http://www.python.org/doc/essays/styleguide.html >>> says "Module names can

Re: matplotlib basic question

2007-04-23 Thread Robert Kern
Pete Forman wrote: > 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 discusse

Re: Redirection problem

2007-04-23 Thread Gabriel Genellina
En Mon, 23 Apr 2007 13:10:55 -0300, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> escribió: > I am new to python. so be patient with me > > I am trying to redirect the output of os.popen command to a file. I > want to append to that file. but instead of appending. The file only > shows last command that

Re: Select weirdness

2007-04-23 Thread Ron Garret
In article <[EMAIL PROTECTED]>, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > 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 v

Re: Redirection problem

2007-04-23 Thread half . italian
On Apr 23, 9:10 am, CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote: > I am new to python. so be patient with me > > I am trying to redirect the output of os.popen command to a file. I > want to append to that file. but instead of appending. The file only > shows last command that was writtenn to it.

Re: Select weirdness

2007-04-23 Thread Ron Garret
In article <[EMAIL PROTECTED]>, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > Twisted does this out of the box, for what it's worth. Thanks. I will look at that. rg -- http://mail.python.org/mailman/listinfo/python-list

pyserial ... timeout on write

2007-04-23 Thread hg
Hi, I notice that pyserial will hang on a write (even with timeout on) if rts/cts are one. Anyway to get around that ? Thanks hg -- http://mail.python.org/mailman/listinfo/python-list

Re: pyserial ... timeout on write

2007-04-23 Thread hg
hg wrote: > Hi, > > I notice that pyserial will hang on a write (even with timeout on) if > rts/cts are one. > > Anyway to get around that ? > > Thanks > > hg PS: on windows -- http://mail.python.org/mailman/listinfo/python-list

Re: wx.TextCtrl.SetDefaultStyle not working?

2007-04-23 Thread [EMAIL PROTECTED]
> On my platform, styling the text doesn't work for single line > TextCtrl's(which seems kind of stupid), and on Windows I think you are > required to specify wx.TE_RICH2 to style the text. This following > code colors the entered text red for me: That's it! I didn't have the TE_RICH2 option set

Re: Select weirdness

2007-04-23 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Ron Garret <[EMAIL PROTECTED]> wrote: > The answer is obvious: select is looking only at the underlying socket, > and not at the rfile buffers. > > So... is this a bug in select? Or a bug in my code? Yes. I don't see any specific followup to this point, but it

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-23 Thread John Nagle
Dennis Lee Bieber wrote: > On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > >>2. File "D:\Python24\lib\socket.py", line 295, in read >>data = self._sock.recv(recv_size) >>error: (10054, 'Connection reset by peer') >> > >

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

2007-04-23 Thread Steve Holden
Neil Cerutti wrote: > On 2007-04-21, Steven D'Aprano <[EMAIL PROTECTED]> wrote: >> On Fri, 20 Apr 2007 15:36:00 -0700, [EMAIL PROTECTED] wrote: The article explains that, amongst other things, tuples are faster than lists, so if you are working with constant values (inmutables) they

Re: Python's handling of unicode surrogates

2007-04-23 Thread Ross Ridge
Ross Ridge writes: > The Unicode standard doesn't require that you support surrogates, or > any other kind of character, so no you wouldn't be lying. <[EMAIL PROTECTED]> wrote: > There is the notion of Unicode implementation levels, and each of them > does include a set of characters to support.

Re: Shebang or Hashbang for modules or not?

2007-04-23 Thread Steve Holden
Michael Hoffman wrote: > Steven W. Orr wrote: >> 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 >> =>>

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread Kjell Magne Fauske
On Apr 23, 6:30 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > I need to be able to generate a PDF report which consists > mostly of vector images (which I can generate as encapsulated > Postscript, PDF, or SVG). What I need is a way to combine > these figures into a single PDF document. Right no

Re: python style guide inconsistencies

2007-04-23 Thread Terry Reedy
"Darren Dale" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Then perhaps http://www.python.org/doc/essays/styleguide.html should either | be updated to either agree with or simply link to PEPs 8 and 257. What is | the point of keeping old, out-of-date essays up on python.org? No

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

2007-04-23 Thread Neil Cerutti
On 2007-04-23, Steve Holden <[EMAIL PROTECTED]> wrote: > Neil Cerutti wrote: >> So the question becomes: Why do Python dictionaries require >> keys to be of an immutable type? > > Because otherwise people would expect to be able to use a list > to select a dictionary entry even after they'd modifie

Re: Learning Python - First Project

2007-04-23 Thread kyosohma
On Apr 23, 9:52 am, KDawg44 <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to Python and am trying to write a little front end to > another application in Python. > > What I want is to have a gui pop up listing some items with several > buttons. The guts of the program I am not having any trouble w

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-23 Thread Steve Holden
John Nagle wrote: > Dennis Lee Bieber wrote: >> On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]> >> declaimed the following in comp.lang.python: >> >> >>> 2. File "D:\Python24\lib\socket.py", line 295, in read >>> data = self._sock.recv(recv_size) >>> error: (10054, 'Connection re

Re: Learning Python - First Project

2007-04-23 Thread kyosohma
On Apr 23, 9:52 am, KDawg44 <[EMAIL PROTECTED]> wrote: > Hi, > > I am new to Python and am trying to write a little front end to > another application in Python. > > What I want is to have a gui pop up listing some items with several > buttons. The guts of the program I am not having any trouble w

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread Grant Edwards
On 2007-04-23, Kjell Magne Fauske <[EMAIL PROTECTED]> wrote: >> Is there a PDF generation library that can place EPS or PDF >> figures on a page? > > If you are familiar with LaTeX, an easy solution would be to > automatically generate a LaTeX document that includes your > images. Yea, I've been

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread half . italian
On Apr 23, 9:30 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > I need to be able to generate a PDF report which consists > mostly of vector images (which I can generate as encapsulated > Postscript, PDF, or SVG). What I need is a way to combine > these figures into a single PDF document. Right no

tftpy 0.41 errors

2007-04-23 Thread manhhle
When trying to import the tftpy package, I've gotten the following error messages: Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tftpy Traceback (most

Re: tftpy 0.41 errors

2007-04-23 Thread Carsten Haese
On Mon, 2007-04-23 at 12:17 -0700, [EMAIL PROTECTED] wrote: > When trying to import the tftpy package, I've gotten the following > error messages: > > Python 2.4.4c1 (#2, Oct 11 2006, 21:51:02) > [GCC 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)] on linux2 > Type "help", "copyright", "cred

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread infidel
On Apr 23, 9:30 am, Grant Edwards <[EMAIL PROTECTED]> wrote: > I need to be able to generate a PDF report which consists > mostly of vector images (which I can generate as encapsulated > Postscript, PDF, or SVG). What I need is a way to combine > these figures into a single PDF document. Right no

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread Grant Edwards
On 2007-04-23, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >> I've looked at ReportLab's documentation, but although it >> appears to be able to use bitmap images (e.g jpeg) it doesn't >> appear to be able to use vector images (EPS/PDF/SVG). >> >> Is there a PDF generation library that can place

Re: Generate report containing pdf or ps figures?

2007-04-23 Thread Grant Edwards
On 2007-04-23, infidel <[EMAIL PROTECTED]> wrote: >> I've looked at ReportLab's documentation, but although it >> appears to be able to use bitmap images (e.g jpeg) it doesn't >> appear to be able to use vector images (EPS/PDF/SVG). >> >> Is there a PDF generation library that can place EPS or >>

Re: Shebang or Hashbang for modules or not?

2007-04-23 Thread Steven W. Orr
On Monday, Apr 23rd 2007 at 17:31 +0100, quoth Michael Hoffman: =>Steven W. Orr wrote: =>> 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/e

Re: Learning Python - First Project

2007-04-23 Thread kyosohma
On Apr 23, 1:44 pm, [EMAIL PROTECTED] wrote: > On Apr 23, 9:52 am, KDawg44 <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > I am new to Python and am trying to write a little front end to > > another application in Python. > > > What I want is to have a gui pop up listing some items with several > >

Launch another application

2007-04-23 Thread KDawg44
Hi, I would like to launch another application and pass some arguments to it from python. WHen the user clicks on the button, i want it to execute: binaryApplication fileName Is there a way to do this as if I was doing it from a shell in python? Would it be using something like popen? this ap

Re: Dictionaries and dot notation

2007-04-23 Thread Bruno Desthuilliers
Martin Drautzburg a écrit : > 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 dict and implementing __getattr__ a

Re: Socket exceptions aren't in the standard exception hierarchy

2007-04-23 Thread John Nagle
Steve Holden wrote: > John Nagle wrote: > >> Dennis Lee Bieber wrote: >> >>> On Sun, 22 Apr 2007 23:20:25 -0700, John Nagle <[EMAIL PROTECTED]> >>> declaimed the following in comp.lang.python: >>> >>> 2. File "D:\Python24\lib\socket.py", line 295, in read data = self._sock.recv(recv_size

Re: Launch another application

2007-04-23 Thread Larry Bates
KDawg44 wrote: > Hi, > > I would like to launch another application and pass some arguments to > it from python. WHen the user clicks on the button, i want it to > execute: > > binaryApplication fileName > > Is there a way to do this as if I was doing it from a shell in > python? Would it be u

  1   2   >