Re: Avoiding argument checking in recursive calls

2009-02-11 Thread Terry Reedy
andrew cooke wrote: Terry Reedy wrote: Reverse the test order def fact(n): if n 0: return fact(n-1)*n if n == 0: return 1 raise ValueError sweet! but is this generally possible? I believe so, for some meaning of 'generally'. ie: did you think this up for this question

Re: hpw to convert a linux python script ?

2009-02-11 Thread John Machin
On Feb 12, 7:48 am, Stef Mientki stef.mien...@gmail.com wrote: Alec Schueler wrote: On Feb 11, 7:58 pm, Stef Mientki stef.mien...@gmail.com wrote: As there are a whole lot of these lines, in a whole lot of files, I wonder if there's a simple trick to point   /usr/share/tinybldLin/ to

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
Steve Holden wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last): File C:\Python25\lib\lib-tk\Tkinter.py, line 1403, in __call__ return self.func(*args) File

Re: Locating python

2009-02-11 Thread David Sevilla
On Feb 3, 7:30 pm, andrew cooke and...@acooke.org wrote: the exact details of what you are reporting seem a bit odd, but i have seen a similar error because i have tried to use my own account to install the package, instead of using root. what i believe happens is that easy_install

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread Graham Dumpleton
2009/2/12 alex goretoy aleksandr.gore...@gmail.com: GAE (Google App Engine) uses WSGI for webapps. You don't have to overhead of managing a server and all it's services this way as well. Just manage dns entries. Although, there are limitations depending on your project needs of what libs you

Re: Unicode issue on Windows cmd line

2009-02-11 Thread MRAB
Benjamin Kaplan wrote: [snip] Whoops. Didn't mean to hit send there. I was going to say, you can't have everything when Microsoft is only willing to break the programs that average people are going to use on a daily basis. I mean, why would they do something nice for the international

CPython loading modules into memory

2009-02-11 Thread sjbrown
Can someone describe the details of how Python loads modules into memory? I assume once the .py file is compiled to .pyc that it is mmap'ed in. But that assumption is very naive. Maybe it uses an anonymous mapping? Maybe it does other special magic? This is all very alien to me, so if someone

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread Mike Driscoll
On Feb 11, 3:27 pm, W. eWatson notval...@sbcglobal.net wrote: Steve Holden wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last):   File

Re: openOffic, windows, and Python 2.5

2009-02-11 Thread Terry Reedy
John Fabiani wrote: Hi, OpenOffice 3 on windows uses python 2.3.x (I have no idea why). I presume because no one has volunteered to do the update for the Py-UNO bridge. In any case, why do you consider that to be a problem. It is common for apps to include the Python they are known to work

Re: CPython loading modules into memory

2009-02-11 Thread Robert Kern
On 2009-02-11 15:30, sjbrown wrote: Can someone describe the details of how Python loads modules into memory? I assume once the .py file is compiled to .pyc that it is mmap'ed in. But that assumption is very naive. Maybe it uses an anonymous mapping? Maybe it does other special magic? This

Re: getopt index out of range

2009-02-11 Thread John Machin
On Feb 11, 6:16 am, Matthew Sacks ntw...@gmail.com wrote: Hi List, I am getting an index out of range error when trying to parse with getopt. Probably something simple. Any suggestions are appreciated optlist, args = getopt.getopt(sys.argv[1:], 'h', ['connectPassword=', 'adminServerURL=',

Re: CPython loading modules into memory

2009-02-11 Thread Martin v. Löwis
Can someone describe the details of how Python loads modules into memory? I assume once the .py file is compiled to .pyc that it is mmap'ed in. But that assumption is very naive. Maybe it uses an anonymous mapping? Maybe it does other special magic? This is all very alien to me, so if

Re: Iterable Ctypes Struct

2009-02-11 Thread Gabriel Genellina
En Wed, 11 Feb 2009 16:32:41 -0200, mark.sea...@gmail.com escribió: On Feb 11, 9:01 am, mark.sea...@gmail.com wrote: On Feb 10, 9:52 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 11 Feb 2009 00:31:26 -0200, mark.sea...@gmail.com escribió: I like the ability to access elements

Re: Unicode issue on Windows cmd line

2009-02-11 Thread jeffg
On Feb 11, 3:57 pm, Martin v. Löwis mar...@v.loewis.de wrote: Having issue on Windows cmd. Python.exe a = u'\xf0' print a This gives a unicode error. Works fine in IDLE, PythonWin, and my Macbook but I need to run this from a windows batch. Character should look like this ð.

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread Robin
On Feb 11, 7:59 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: On Feb 11, 8:50 pm, Robin robi...@gmail.com wrote: Hi, I am building some computational web services using soaplib. This creates a WSGI application. However, since some of these services are computationally

Re: getopt index out of range

2009-02-11 Thread Matthew Sacks
Perhaps you can give me a call privately and I will explain it to you. Regards, Matthew On Wed, Feb 11, 2009 at 1:48 PM, John Machin sjmac...@lexicon.net wrote: On Feb 11, 6:16 am, Matthew Sacks ntw...@gmail.com wrote: Hi List, I am getting an index out of range error when trying to parse with

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread Robin
On Feb 11, 9:32 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: 2009/2/12 alex goretoy aleksandr.gore...@gmail.com: GAE (Google App Engine) uses WSGI for webapps. You don't have to overhead of managing a server and all it's services this way as well. Just manage dns entries.

Re: getopt index out of range

2009-02-11 Thread Matthew Sacks
Keep your threadiquette to yourself. On Wed, Feb 11, 2009 at 1:48 PM, John Machin sjmac...@lexicon.net wrote: On Feb 11, 6:16 am, Matthew Sacks ntw...@gmail.com wrote: Hi List, I am getting an index out of range error when trying to parse with getopt. Probably something simple. Any

Re: ANN: Python 2.6 Quick Reference available

2009-02-11 Thread Giampaolo Rodola'
On Feb 10, 8:38 pm, Richard Gruet rgruet at free dot fr wrote: The Python 2.6 Quick Reference is available in HTML and PDF formats athttp://rgruet.free.fr/#QuickRef. This time I was helped by Josh Stone for the update. As usual, your feedback is welcome (pqr at rgruet.net). Cheers,

Re: Unicode issue on Windows cmd line

2009-02-11 Thread Benjamin Kaplan
On Wed, Feb 11, 2009 at 5:10 PM, jeffg jeffgem...@gmail.com wrote: On Feb 11, 3:57 pm, Martin v. Löwis mar...@v.loewis.de wrote: Having issue on Windows cmd. Python.exe a = u'\xf0' print a This gives a unicode error. Works fine in IDLE, PythonWin, and my Macbook but I need

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread alex goretoy
GAE is definitely not suitable in this case... The servers are provided and maintained as part of a large scientific project for which I am providing just a few services... Other groups are running services in other platforms on tomcat through soaplab/instantsoap - but I was hoping to use

Re: best way to serve wsgi with multiple processes

2009-02-11 Thread Graham Dumpleton
On Feb 12, 9:19 am, Robin robi...@gmail.com wrote: On Feb 11, 7:59 pm, Graham Dumpleton graham.dumple...@gmail.com wrote: On Feb 11, 8:50 pm, Robin robi...@gmail.com wrote: Hi, I am building some computational web services using soaplib. This creates a WSGI application.

Re: Clearing the keyboard buffer (wxPython)

2009-02-11 Thread Antoine De Groote
yes, the server seems to have been down :-( MarcusD wrote: Whow. Thanks for the fast and comprehensive answer. To be honest I would have posted to wxpython.org but the server seems to be down for the last couple of days. I'll check this wx.Yield thing that I never heard of. And let's see

where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
I've just been reading the docs to help me with a SocketServer issue. I found in the docs (http://docs.python.org/library/socketserver.html) a reference to a member attribute timeout and a member function handle_timeout() is made. I am using python 2.5 and there's no indication that these were

Can I 'LOOK' through urllib?

2009-02-11 Thread Muddy Coder
Hi Folks, I feel good after played urllib with fun! Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there are many files located in http://www.somedomain.com/data_folder, but I don't know what the filenames are residing in

Re: where is handle_timeout in SocketServer

2009-02-11 Thread Daniel
On Feb 11, 4:01 pm, Daniel daniel.watr...@gmail.com wrote: I've just been reading the docs to help me with a SocketServer issue. I found in the docs (http://docs.python.org/library/socketserver.html) a reference to a member attribute timeout and a member function handle_timeout() is made.  I

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
Mike Driscoll wrote: On Feb 11, 3:27 pm, W. eWatson notval...@sbcglobal.net wrote: Steve Holden wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last): File

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Chris Rebert
On Wed, Feb 11, 2009 at 3:17 PM, Muddy Coder cosmo_gene...@yahoo.com wrote: Hi Folks, I feel good after played urllib with fun! Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there are many files located in

Re: Unicode issue on Windows cmd line

2009-02-11 Thread Martin v. Löwis
Thanks, I ended up using encode('iso-8859-15', replace) Perhaps more up to date than cp1252...?? It still didn't print correctly, but it did write correctly, which was my main problem. If you encode as iso-8859-15, but this is not what your terminal expects, it certainly won't print

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Paul Rubin
Muddy Coder cosmo_gene...@yahoo.com writes: Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there are many files located in http://www.somedomain.com/data_folder, but I don't know what the filenames are residing in the

Re: re.sub and named groups

2009-02-11 Thread Rhodri James
On Wed, 11 Feb 2009 21:05:53 -, Paul McGuire pt...@austin.rr.com wrote: On Feb 4, 10:51 am, Emanuele D'Arrigo man...@gmail.com wrote: Hi everybody, I'm having a ball with the power of regular expression Don't forget the ball you can have with the power of ordinary Python strings,

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Christian Heimes
Muddy Coder schrieb: Hi Folks, I feel good after played urllib with fun! Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there are many files located in http://www.somedomain.com/data_folder, but I don't know what

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Grant Edwards
On 2009-02-11, Muddy Coder cosmo_gene...@yahoo.com wrote: Hi Folks, I feel good after played urllib with fun! Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there are many files located in

Re: Can I 'LOOK' through urllib?

2009-02-11 Thread Grant Edwards
On 2009-02-12, Grant Edwards gra...@visi.com wrote: On 2009-02-11, Muddy Coder cosmo_gene...@yahoo.com wrote: Hi Folks, I feel good after played urllib with fun! Now I want to LOOK to server through urllib. I read the urllib docs, but I did not find such a function. For example, if there

Embed a web browser into a page

2009-02-11 Thread Carbon Man
Hi, I need to embed a web browser into a python page. I am coming from the MS world where I created an app that all of it's interfaces were actually web pages rendered in an Internet Explorer activex control. There was a object hook that allowed you to call into the host environment from

Re: ANN: Python 2.6 Quick Reference available

2009-02-11 Thread Markus Schreyer
Great stuff! Waiting for the 3.0 version.. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python 2.6 Quick Reference available

2009-02-11 Thread python
Richard, An excellent tool. Great job!!! Thank you for sharing this with the Python community. Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2.Request:: http Request sending successfully, but Response contains in valid data.

2009-02-11 Thread Steven D'Aprano
On Wed, 11 Feb 2009 01:56:19 -0800, nRk wrote: Hi I am trying to send Data to a website through http using urllib.request library using the bellow code. Response status code contains. 200 (OK) but Response contains nothing... No it doesn't, you say so later: it contains a set of bare

SQL error

2009-02-11 Thread Dan McKenzie
Hi Guys, I am trying to move data from a file into our mysql database. The format of the text file is - ipaddress ipaddress bytes packets interface-in interface-out eg: 192.168.1.1 192.168.1.2 1522 12 * rob The sql table is 'ipflows' This is the code:

Re: Unexpected string behaviour: txt = 'this' ' works'

2009-02-11 Thread Steven D'Aprano
On Wed, 11 Feb 2009 12:57:31 -0800, bearophileHUGS wrote: Jason: It's such a minor optimization, that you probably wouldn't see any effect on your program. from dis import dis def f(): ... return 'This is ' + 'an example.' ... dis(f) 2 0 LOAD_CONST 3 ('This is

Re: Unicode issue on Windows cmd line

2009-02-11 Thread jeffg
On Feb 11, 6:30 pm, Martin v. Löwis mar...@v.loewis.de wrote: Thanks, I ended up using encode('iso-8859-15', replace) Perhaps more up to date than cp1252...?? It still didn't print correctly, but it did write correctly, which was my main problem. If you encode as iso-8859-15, but this

Re: SQL error

2009-02-11 Thread John Machin
On Feb 12, 11:57 am, Dan McKenzie d...@puddle.net.au wrote: Hi Guys, I am trying to move data from a file into our mysql database. The format of the text file is - ipaddress ipaddress bytes packets   interface-in interface-out eg: 192.168.1.1 192.168.1.2 1522 12 * rob The sql table is

how can this iterator be optimized?

2009-02-11 Thread Basilisk96
Hello all, I have the following function that uses an intermediate iterator rawPairs: def MakePairs(path): import os import operator join = os.path.join rawPairs = ( (join(path, s), func(s)) for s in os.listdir(path) if func(s) is not None and

Re: how can this iterator be optimized?

2009-02-11 Thread Gabriel Genellina
En Wed, 11 Feb 2009 23:22:26 -0200, Basilisk96 basilis...@gmail.com escribió: def MakePairs(path): import os import operator join = os.path.join rawPairs = ( (join(path, s), func(s)) for s in os.listdir(path) if func(s) is not None and

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
Hi Gabriel; Not sure what generic attribute container is. I am reading in from xml file all reg names for a chip. So then I'd be able to use python scripts to access the regs. So eventually this class will get subclassed w/ hw access instead of just saving in int. So I want to call this

Re: CPython loading modules into memory

2009-02-11 Thread sjbrown
On Feb 11, 2:00 pm, Martin v. Löwis mar...@v.loewis.de wrote: Can someone describe the details of how Python loads modules into memory?  I assume once the .py file is compiled to .pyc that it is mmap'ed in.  But that assumption is very naive.  Maybe it uses an anonymous mapping?  Maybe it

Another optimization request :-)

2009-02-11 Thread jeffg
If anyone wants to take this on... I would really really like to have the spring_layout modified to support multi-threading if at all possible. My test data is 20,000, which makes this process 20,000 x 20,000 or 400,000,000 (400 million) calculations. This is taking somewhere between 2-3 hours an

Re: Iterable Ctypes Struct

2009-02-11 Thread Marc 'BlackJack' Rintsch
On Wed, 11 Feb 2009 17:33:23 -0800, mark.seagoe wrote: Not sure what generic attribute container is. I am reading in from xml file all reg names for a chip. Are you using instances of that class to interface C code or to read/ write data intended to be read or written by a C program? If not

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread drobi...@gmail.com
On Feb 11, 2:51 pm, Steve Holden st...@holdenweb.com wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last):   File C:\Python25\lib\lib-tk\Tkinter.py, line 1403, in

Re: Iterable Ctypes Struct

2009-02-11 Thread mark . seagoe
On Feb 11, 5:51 pm, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Wed, 11 Feb 2009 17:33:23 -0800, mark.seagoe wrote: Not sure what generic attribute container is.  I am reading in from xml file all reg names for a chip. Are you using instances of that class to interface C code or to

Re: Another optimization request :-)

2009-02-11 Thread andrew cooke
why are you dong this point by point? surely you can express the physics as a set of equations and invert the matrix? wouldn't that be a lot faster? you'd replace the iteration over all combinations of points with a faster matrix inversion. see for example

select.poll.poll() never blocks

2009-02-11 Thread birdsong
I'm pretty sure I've exhausted all searches and read all the forums Google will turn up related to this issue. I touch an empty file in a sh shell, fire up the python shell, open the file for reading(tried all buffering options), register it with a poll object for select.POLLIN and call poll(),

Re: select.poll.poll() never blocks

2009-02-11 Thread Jean-Paul Calderone
On Wed, 11 Feb 2009 18:44:53 -0800 (PST), birdsong david.birds...@gmail.com wrote: I'm pretty sure I've exhausted all searches and read all the forums Google will turn up related to this issue. I touch an empty file in a sh shell, fire up the python shell, open the file for reading(tried all

Re: Another optimization request :-)

2009-02-11 Thread andrew cooke
sorry, that was stupid. there is no inversion (apart from 1/m), just the integration. still, improving the integration would allow larger steps. andrew andrew cooke wrote: why are you dong this point by point? surely you can express the physics as a set of equations and invert the

Re: Unicode issue on Windows cmd line

2009-02-11 Thread Gabriel Genellina
En Wed, 11 Feb 2009 23:11:37 -0200, jeffg jeffgem...@gmail.com escribió: On Feb 11, 6:30 pm, Martin v. Löwis ma...@v.loewis.de wrote: Thanks, I ended up using encode('iso-8859-15', replace) Perhaps more up to date than cp1252...?? If you encode as iso-8859-15, but this is not what your

Re: select.poll.poll() never blocks

2009-02-11 Thread birdsong
So I guess I didn't have a complete understanding of poll, I thought it returned file descriptors that had registered an event that the user asked to watch for. In my case, select.POLLIN ConstantMeaning POLLIN There is data to read ...there ins't any data to be read. The file is

Re: Iterable Ctypes Struct

2009-02-11 Thread Gabriel Genellina
En Thu, 12 Feb 2009 00:02:12 -0200, mark.sea...@gmail.com escribió: On Feb 11, 5:51 pm, Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Wed, 11 Feb 2009 17:33:23 -0800, mark.seagoe wrote: Not sure what generic attribute container is.  I am reading in from xml file all reg names for a

Re: select.poll.poll() never blocks

2009-02-11 Thread Rhodri James
On Thu, 12 Feb 2009 03:01:16 -, birdsong david.birds...@gmail.com wrote: So I guess I didn't have a complete understanding of poll, I thought it returned file descriptors that had registered an event that the user asked to watch for. In my case, select.POLLIN ConstantMeaning

Re: select.poll.poll() never blocks

2009-02-11 Thread Miles
On Wed, Feb 11, 2009 at 10:47 PM, Rhodri James rho...@wildebst.demon.co.uk wrote: If you want to do it in Python, the only thing that springs to mind is periodically checking the size of the file and reading more when that changes. You'll need to be very careful to keep what size you think

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
drobi...@gmail.com wrote: On Feb 11, 2:51 pm, Steve Holden st...@holdenweb.com wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last): File

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
drobi...@gmail.com wrote: On Feb 11, 2:51 pm, Steve Holden st...@holdenweb.com wrote: W. eWatson wrote: Steve Holden wrote: W. eWatson wrote: My program in IDLE bombed with: == Exception in Tkinter callback Traceback (most recent call last): File

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
The two separate loops being PyWin (which uses MFC) and your program (which uses Tkinter). You just can't mix GUIs in the same process like that, sorry. regards Stedve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ Deja-vu!

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
So, how do I get rid of it? reboot? Just to re-iterate the I provided the question to above, I'm using Tkinter for the program's GUI. -- W. eWatson (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time) Obz Site: 39° 15' 7 N, 121° 2'

Re: Who's on First, IDLE or pythonWin? Dialog Problem?

2009-02-11 Thread W. eWatson
It looks like I got an accidentally case of send message 3 times. Well, here's a correct below. The question now is what can I do about it? reboot? Just to re-iterate the answer I provided to *the question to a post above*, I'm using Tkinter for the program's GUI. --

Re: Unicode issue on Windows cmd line

2009-02-11 Thread jeffg
On Feb 11, 10:00 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Wed, 11 Feb 2009 23:11:37 -0200, jeffg jeffgem...@gmail.com escribió: On Feb 11, 6:30 pm, Martin v. Löwis ma...@v.loewis.de wrote: Thanks, I ended up using encode('iso-8859-15', replace) Perhaps more up to date

Re: Another optimization request :-)

2009-02-11 Thread jeffg
On Feb 11, 9:56 pm, andrew cooke and...@acooke.org wrote: sorry, that was stupid.  there is no inversion (apart from 1/m), just the integration. still, improving the integration would allow larger steps. andrew andrew cooke wrote: why are you dong this point by point?  surely you can

Re: how can this iterator be optimized?

2009-02-11 Thread Basilisk96
Don't use a generator then. If you're going to finally return a list (and   sorted does exactly that), build a list right from the start: Good point. However, for the sake of argument, what if I removed the sorting requirement and simply wanted the generator? I usually strive for comprehensions

TTS in windows

2009-02-11 Thread Jonathan Chacón
Hello, I need to use SAPI5 text to speech with python but I don't find anything that lets me manage speech, tone, volume, etc Does anybody know anything to do this? Thanks and regards Jonathan Chacón -- http://mail.python.org/mailman/listinfo/python-list

Breaking Python list into set-length list of lists

2009-02-11 Thread Jason
Hey everyone-- I'm pretty new to Python, I need to do something that's incredibly simple, but combing my Python Cookbook googling hasn't helped me out too much yet, and my brain is very, very tired flaccid @ the moment I have a list of objects, simply called list. I need to break it into

Thank you, Tkinter. (easy to use)

2009-02-11 Thread argo785
Tonight I needed to draw a series of simple shapes in a window using a bit of math but didn't have much time to do it. I've got very little GUI toolkit experience. Briefly had a look at the usually-recommended heavyweight GUI toolkits, but I didn't want to inherit from widget classes or override

Re: how can this iterator be optimized?

2009-02-11 Thread Terry Reedy
Basilisk96 wrote: Don't use a generator then. If you're going to finally return a list (and sorted does exactly that), build a list right from the start: Good point. However, for the sake of argument, what if I removed the sorting requirement and simply wanted the generator? Write a

Re: Breaking Python list into set-length list of lists

2009-02-11 Thread Mensanator
On Feb 11, 10:58�pm, Jason elgrandchig...@gmail.com wrote: Hey everyone-- I'm pretty new to Python, I need to do something that's incredibly simple, but combing my Python Cookbook googling hasn't helped me out too much yet, and my brain is very, very tired flaccid @ the moment I

Re: TTS in windows

2009-02-11 Thread Mark Hammond
On 12/02/2009 3:58 PM, Jonathan Chacón wrote: Hello, I need to use SAPI5 text to speech with python but I don't find anything that lets me manage speech, tone, volume, etc Does anybody know anything to do this? It appears this is doable from COM. With the pywin32 package: import

Need an application sends from paricular port

2009-02-11 Thread Sambit Samal
Hi I am new to Python world I need a python script , which binds at a user defind port sends to other enity , which waits at particular port. The other enity will respond Python script should receive that at the defined port The communication will happen over UDP e.g *Python Appl* IP:

Re: Another optimization request :-)

2009-02-11 Thread Terry Reedy
jeffg wrote: If anyone wants to take this on... I would really really like to have the spring_layout modified to support multi-threading if at all possible. My test data is 20,000, which makes this process 20,000 x 20,000 or 400,000,000 (400 million) calculations. This is taking somewhere

explain

2009-02-11 Thread Saeed Iravani
Hello, I want to use python but I do not know that I install Python or ActivePython or VPython or Jython? My operating system is Windows XP SP2. Please explain for me completely. -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmatically changing network proxy settings on the Mac

2009-02-11 Thread Python Nutter
OS X is POSIX/UNIX system so your basic plan of going about things: 1. Learn what proxy/network subsystem Tiger uses 2. Learn what proxy/network subsystem Leopard uses (same as 1., or has it changed?) 3. Based on 1 and 2 learn the config file names and locations. 4. Based on 3 you will determine

Re: Breaking Python list into set-length list of lists

2009-02-11 Thread Terry Reedy
Jason wrote: I have a list of objects, simply called list. Bad idea. I need to break it into an array (list of lists) wherein each sublist is the length of the variable items_per_page. So array[0] would go from array[0][0] to array[0][items_per_page], then bump up to array[1][0] -

Re: Breaking Python list into set-length list of lists

2009-02-11 Thread Steven D'Aprano
On Wed, 11 Feb 2009 20:58:28 -0800, Jason wrote: I have a list of objects, simply called list. Generally speaking, that's not a good choice of names, because it over- writes (shadows) the built-in function list(). I need to break it into an array (list of lists) wherein each sublist is

Re: explain

2009-02-11 Thread gofkuckyourself
Saeed, The standard Python distribution is community supported and available on Windows http://www.python.org/download/windows/ ActivePython is ActiveState's version of Python with extra libraries and commercial support available VPython I am not familiar with, perhaps someone else can speak to

Re: select.poll.poll() never blocks

2009-02-11 Thread birdsong
On Feb 11, 7:47 pm, Rhodri James rho...@wildebst.demon.co.uk wrote: On Thu, 12 Feb 2009 03:01:16 -, birdsong david.birds...@gmail.com   wrote: So I guess I didn't have a complete understanding of poll, I thought it returned file descriptors that had registered an event that the user

Re: explain

2009-02-11 Thread Python Nutter
If your use is to Generically want to use python on Windows XP you install the standard/generic Python that you download from python.org Without any details to decide with, I would also say download version 2.5.4 of Python from python.org 2009/2/12 Saeed Iravani si.4...@yahoo.com: Hello, I want

Re: Avoiding argument checking in recursive calls

2009-02-11 Thread Steven D'Aprano
On Wed, 11 Feb 2009 04:31:10 -0500, Terry Reedy wrote: Steven D'Aprano ste...@remove.this.cybersource.com.au writes: def fact(n): if n 0: raise ValueError if n = 0: return 1 return fact(n-1)*n At the risk of premature optimization, I wonder if there is an idiom for avoiding

Re: how can this iterator be optimized?

2009-02-11 Thread Steven D'Aprano
On Wed, 11 Feb 2009 20:26:12 -0800, Basilisk96 wrote: Don't use a generator then. If you're going to finally return a list (and sorted does exactly that), build a list right from the start: Good point. However, for the sake of argument, what if I removed the sorting requirement and simply

Re: Functional schmunctional...

2009-02-11 Thread Hendrik van Rooyen
Steve Holden stenweb.com wrote: Jeez, doesn't anyone read the fine manual any more? I hope this was just an academic exercise. socket.inet_ntoa(struct.pack(!l, 10)) '59.154.202.0' Holden's rule: when it looks simple enough to be worth including in the standard library it

Re: Thank you, Tkinter. (easy to use)

2009-02-11 Thread r
Hello, Tkinter is a great GUI toolkit, for what it lacks in prettiness it more than makes up for in simple and quick GUI building. I think this is the main reason Tkinter continues to be Python's built-in GUI toolkit. It is a great place to start for those with no GUI experience. Sure it will

Re: select.poll.poll() never blocks

2009-02-11 Thread Hendrik van Rooyen
birdsong dav...@gmail.comwrote: 8--- select not blocking on empty file stuff - Any help on what I'm missing would be appreciated. Why do you expect it to block? It is ready to read, to return end of file. - Hendrik --

Re: Breaking Python list into set-length list of lists

2009-02-11 Thread Mark Tolonen
Jason elgrandchig...@gmail.com wrote in message news:8158439d-faae-4889-a1cf-8d9fee112...@v39g2000yqm.googlegroups.com... Hey everyone-- I'm pretty new to Python, I need to do something that's incredibly simple, but combing my Python Cookbook googling hasn't helped me out too much yet, and

Re: Python binaries with VC++ 8.0?

2009-02-11 Thread Tim Roberts
Paul Rubin http://phr...@nospam.invalid wrote: In case anyone is interested: Gideon Smeding of the University of Utrecht has written a masters' thesis titled An executable operational semantics for Python. That's an interesting grammatical construct. I would have said either Executable

Re: select.poll.poll() never blocks

2009-02-11 Thread birdsong
On Feb 11, 10:36 pm, Hendrik van Rooyen m...@microcorp.co.za wrote: birdsong dav...@gmail.comwrote: 8--- select not blocking on empty file stuff - Any help on what I'm missing would be appreciated. Why do you expect it to block? It is ready to read, to return end

RE: TTS in windows

2009-02-11 Thread Jonathan Chacón
-Mensaje original- De: Mark Hammond [mailto:skippy.hamm...@gmail.com] Enviado el: jueves, 12 de febrero de 2009 6:47 It appears this is doable from COM. With the pywin32 package: Well, I have problems to install pywin32 (pywin32-212.win32-py2.5.exe) I'll try to solve that problem

Re: Breaking Python list into set-length list of lists

2009-02-11 Thread Gerard Flanagan
Jason wrote: Hey everyone-- I'm pretty new to Python, I need to do something that's incredibly simple, but combing my Python Cookbook googling hasn't helped me out too much yet, and my brain is very, very tired flaccid @ the moment I have a list of objects, simply called list. I need

which language has syntax that visually represent a tree? [was X#]

2009-02-11 Thread Xah Lee
syntax that represent a tree purely [was X#] On Jan 21, 3:13 am, Pascal Costanza p...@p-cos.net wrote: LOL: http://www.xsharp.org/samples/ Today, i was nosing about some blogs, which made me come to: http://blog.fogus.me/2009/02/06/yegge-clojure-arc-and-lolita-or-days-of-future-past in which

[issue5200] unicode.normalize gives wrong result for some characters

2009-02-11 Thread Peter Landgren
Peter Landgren peter.tal...@telia.com added the comment: Martin v. Löwis mar...@v.loewis.de added the comment: The same applies Å and A, Ä and A and Ö and O which also are also different letters as Ø and O are. Sure. And rightfully, they Å is *not* (I repeat: not) normalized as A, under

[issue5211] Fix complex type to avoid coercion in 2.7.

2009-02-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: Comment by gumtree copied from issue3734 discussion: While Mark Dickinson's patch fixes the documentation, it does not offer a solution to the original problem, which was rooted in a need to provide special behaviour based on the

[issue3734] subclassing complex

2009-02-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [gumtree] [...] does not offer a solution to the original problem, which was rooted in a need to provide special behaviour based on the numeric types. I made the original posting because I hoped that this problem could be resolved.

[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-11 Thread Adam Olsen
Adam Olsen rha...@gmail.com added the comment: The alignment requirements (long double) make it impossible to have anything in those bits. Hypothetically, a custom allocator could lower the alignment requirements to sizeof(void *). However, rotating to the high bits is pointless as they're the

[issue1552880] Unicode Imports

2009-02-11 Thread Kristján Valur Jónsson
Kristján Valur Jónsson krist...@ccpgames.com added the comment: Ah, this one is still alive? We still use this patch at CCP for our 2.x python. I'll give it some more love to answer the issues raised. Hm, is this still an issue with 3.x? Does the imput machinery use unicode as the internal

[issue5186] Reduce hash collisions for objects with no __hash__ method

2009-02-11 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: [Adam Olsen] The alignment requirements (long double) make it impossible to have anything in those bits. Not necessarily, since not all pointers passed to _Py_HashPointer come from a PyObject_Malloc. _Py_HashPointer is used for function

[issue1552880] Unicode Imports

2009-02-11 Thread Thomas Heller
Changes by Thomas Heller thel...@ctypes.org: -- nosy: +theller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1552880 ___ ___ Python-bugs-list

<    1   2   3   4   >