Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-28 Thread Paul Rubin
malkarouri [EMAIL PROTECTED] writes: FWIW, I find #1 more interesting for me personally. As a monad-challenged person, I find it much easier to develop components using pure functional programming in a language like Haskell and do all my I/O in Python than having it the other way round.

Re: problem with sorting

2008-03-28 Thread jwelby
On Mar 28, 5:38 am, [EMAIL PROTECTED] wrote: dict = {'M':3, 'R':0, 'S':2} print dict {'S': 2, 'R': 0, 'M': 3} now if I wanted sorted values in list, i am not able to do this print dict.values().sort() None it returns None instead of [0, 2, 3] The sort method works by sorting 'in

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-28 Thread Paul Rubin
Michaâ Janeczek [EMAIL PROTECTED] writes: I wasn't aware of the runtime issues, these can be things to watch out for. However, the type of embedding that I imagined would be mostly pure functions, since Python can deal with IO rather well. It'd also be applicable in situations where we want to

Re: problem with sorting

2008-03-28 Thread raj
To ankit: Well, sort() doesn't return the sorted list. It returns None. Why not this straightforward way? dvals = dict.values() dvals.sort() print dvals -- http://mail.python.org/mailman/listinfo/python-list

Plugins accessing parent state

2008-03-28 Thread [EMAIL PROTECTED]
Does anyone have some design ideas ( or can point me at the right design pattern, because I can't find it. ) for having a plugin being able to access a parent's state? For example, let's say I have a class that receives some commands. When it gets a command, it checks which of the registered

Re: Plugins accessing parent state

2008-03-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: Does anyone have some design ideas ( or can point me at the right design pattern, because I can't find it. ) for having a plugin being able to access a parent's state? For example, let's say I have a class that receives some commands. When it gets a command, it

Re: Getting back an Object

2008-03-28 Thread Bruno Desthuilliers
Gary Herron a écrit : (snip) One other word of warning. It is best to not use a variable named string as Python has a builtin type of that name which would become inaccessible if you redefine. Good advice, except that the builtin string type is actually named 'str', not 'string' !-) --

chronic error with python on mac os/x 10.5

2008-03-28 Thread Tzury Bar Yochay
Although I am experiencing this problem using a specific domain library (pjsip). Googling this issue show that it is happening to many libraries in python on mac. I was wondering whether anyone solved this or alike in the past and might share what steps were taken. Note: this python lib works

Eclipse and PyDev Package explorer

2008-03-28 Thread king kikapu
Hi, i am trying to fit Eclipse/Pydev in my needs/preference, so i want to ask this: As it is now, i see all my projects in that TreeView (PyDev Package Explorer). I would rather want this to behave like a more normal IDE where you Open one project and if you want close it and Open another, just

Re: Plugins accessing parent state

2008-03-28 Thread [EMAIL PROTECTED]
On Mar 28, 1:58 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: Does anyone have some design ideas ( or can point me at the right design pattern, because I can't find it. ) for having a plugin being able to access a parent's state? For example, let's say I

Re: Eclipse and PyDev Package explorer

2008-03-28 Thread king kikapu
A, and another one: If i set a custom builder for a pydev project, is there a way for this builder to automatically be assigned to every (pydev) project i will create from now on or i have to re-define it for every new one ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Plugins accessing parent state

2008-03-28 Thread André
On Mar 28, 6:39 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Mar 28, 1:58 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: [EMAIL PROTECTED] schrieb: Does anyone have some design ideas ( or can point me at the right design pattern, because I can't find it. ) for having a plugin

Re: any good g.a.'s?

2008-03-28 Thread castironpi
On Mar 25, 11:03 am, Tim Chase [EMAIL PROTECTED] wrote: Any good genetic algorithms involving you-split, i-pick? I've always heard it as you divide, I decide... That said, I'm not sure how that applies in a GA world.  It's been a while since I've done any coding with GAs, but I don't

pygame handoff

2008-03-28 Thread castironpi
Can anyone do a simple pygame render of a rollercoaster in first- person? I'll do the generator. Just for fun for free. (Ha see pythaagh. He bothered to carve it. Have a nice day.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamic code problem

2008-03-28 Thread Simon Brunning
On Thu, Mar 27, 2008 at 4:13 PM, [EMAIL PROTECTED] wrote: My dynamic code failed at this site http://playwide1.extra.hu/, need some help thank you. http://catb.org/~esr/faqs/smart-questions.html -- Cheers, Simon B. [EMAIL PROTECTED] http://www.brunningonline.net/simon/blog/ GTalk:

Re: problem with sorting

2008-03-28 Thread castironpi
On Mar 28, 1:57 am, raj [EMAIL PROTECTED] wrote: To ankit: Well, sort() doesn't return the sorted list. It returns None. Why not this straightforward way? dvals = dict.values() dvals.sort() print dvals Why not sorted( dict.values() ). Can it return the right things from the right things

Re: Dynamic code problem

2008-03-28 Thread castironpi
On Mar 28, 5:14 am, Simon Brunning [EMAIL PROTECTED] wrote: On Thu, Mar 27, 2008 at 4:13 PM,  [EMAIL PROTECTED] wrote: My dynamic code failed at this sitehttp://playwide1.extra.hu/, need  some help thank you. http://catb.org/~esr/faqs/smart-questions.html I almost clicked on that *plonk*.

Re: Eclipse and PyDev Package explorer

2008-03-28 Thread olive
Hi, normally you just have to select your top level project folder in the Package Explorer and then from the menu bar choose Project - Close Project (also accessible by the popup menu assigned to the right button of your mouse). HTH, Olivier. --

Re: problem with sorting

2008-03-28 Thread Duncan Booth
[EMAIL PROTECTED] wrote: On Mar 28, 1:57ÿam, raj [EMAIL PROTECTED] wrote: To ankit: Well, sort() doesn't return the sorted list. It returns None. Why not this straightforward way? dvals = dict.values() dvals.sort() print dvals Why not sorted( dict.values() ). If you are going to do

Re: Plugins accessing parent state

2008-03-28 Thread Bruno Desthuilliers
André a écrit : On Mar 28, 6:39 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Mar 28, 1:58 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: (snip) But to be honest: you are thinking much to far there - after all, it's all *your* code, and inside one interpreter. A real isolation isn't

Re: **************************************************************

2008-03-28 Thread Jetus
On Mar 28, 5:44 am, [EMAIL PROTECTED] wrote: ** When you make a Web page available offline, you can read its content when your computer is not connected to the Internet. For example, you can view Web pages on your laptop computer

simple web-server

2008-03-28 Thread Pavol Murin
hello python users, could you point me to a very simple (single file is best) web-server? I want to serve a few web-forms and run some shell scripts when the forms are submitted. I might add Ajax later (this is not a requirement, if it only supports forms it's OK). Longer story: I would like

Re: chronic error with python on mac os/x 10.5

2008-03-28 Thread martin . laloux
I don't known pjsip but this problem generally occurs when the library (dylib) on which the file (.so) depends is not the good one Googling this issue show that it is happening to many libraries in python on mac. ?? I am working in python on mac since a lot of time I seldom have such

Re: problem with sorting

2008-03-28 Thread bearophileHUGS
Duncan Booth: Both this and raj's suggestion create a single sorted list. Your suggestion creates two lists: the unsorted one and a separate sorted one. In most cases the difference is probably insignificant, but if you have a *lot* of values it might make a difference. The good thing of

Re: PyQT / QDate / QTableWidget

2008-03-28 Thread David Boddie
On Wed Mar 26 15:13:09 CET 2008, wrightee wrote: My server gives me a string y[0]: 20080327, which I convert to a QDateTime object using: x=QDateTime.fromString(y[0],mmdd) Printing x.toString(dd-mm-) gives me what I would expect - 27-03-2008 Strange. You should really be using

Re: simple web-server

2008-03-28 Thread Larry Bates
On Fri, 2008-03-28 at 12:53 +0100, Pavol Murin wrote: hello python users, could you point me to a very simple (single file is best) web-server? I want to serve a few web-forms and run some shell scripts when the forms are submitted. I might add Ajax later (this is not a requirement, if it

Global variables in modules...

2008-03-28 Thread ttsiodras
With a.py containing this: == a.py === #!/usr/bin/env python import b g = 0 def main(): global g g = 1 b.callb() if __name__ == __main__: main() == ...and b.py containing... = b.py = import a, sys def callb():

Re: csv Parser Question - Handling of Double Quotes

2008-03-28 Thread Aaron Watters
On Mar 27, 6:00 pm, John Machin [EMAIL PROTECTED] wrote: ...The Python csv module emulates Excel in delivering garbage silently in cases when the expected serialisation protocol has (detectably) not been followed Fine, but I'd say the heuristic adopted produces bizarre and surprising

Re: Dynamic code problem

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 07:14:17 -0300, Simon Brunning [EMAIL PROTECTED] escribió: On Thu, Mar 27, 2008 at 4:13 PM, [EMAIL PROTECTED] wrote: My dynamic code failed at this site http:///, need some help thank you. http://catb.org/~esr/faqs/smart-questions.html I assumed it was just spam,

base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
I'm using a md5 hash encoded with base64.urlsafe_b64encode as a parameter of a URL used to confirm a registration in a site. It has been working great. The url is like this: http://example.com/ce?i=878h=kTfWSUaby5sBu9bIfoR87Q== Now i need to match that URL in a certain text and i realized that

How do I reconnect a disconnected socket?

2008-03-28 Thread Jason Kristoff
I'm trying to make something that once it is disconnected will automatically try to reconnect. I'll add some more features in later so it doesn't hammer the server but right now I just want to keep it simple and get that part working. The problem is that when I use sock.close I get an error

Re: Global variables in modules...

2008-03-28 Thread Peter Otten
[EMAIL PROTECTED] wrote: With a.py containing this: == a.py === #!/usr/bin/env python import b g = 0 def main(): global g g = 1 b.callb() if __name__ == __main__: main() == ...and b.py containing... = b.py

Re: simple web-server

2008-03-28 Thread Thomas Guettler
Pavol Murin schrieb: hello python users, could you point me to a very simple (single file is best) web-server? I want to serve a few web-forms and run some shell scripts when the forms are submitted. I might add Ajax later (this is not a requirement, if it only supports forms it's OK). If

Re: simple web-server

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 08:53:15 -0300, Pavol Murin [EMAIL PROTECTED] escribió: could you point me to a very simple (single file is best) web-server? I want to serve a few web-forms and run some shell scripts when the forms are submitted. I might add Ajax later (this is not a requirement, if it

Re: simple web-server

2008-03-28 Thread Bernard
Did you take a look at web.py? That one looks terribly small and efficient :) We use CherryPy coupled with compiled Cheetah Templates for every web server based projects at my workplace and we've been really satisfied with it so far. On 28 mar, 07:53, Pavol Murin [EMAIL PROTECTED] wrote: hello

Summary of threading for experienced non-Python programmers?

2008-03-28 Thread skip
I'm having trouble explaining the benefits and tradeoffs of threads to my coworkers and countering their misconceptions about Python's threading model and facilities. They all come from C++ and are used to thinking of multithreading as a way to harness multiple CPU cores for compute-bound

Re: Global variables in modules...

2008-03-28 Thread ttsiodras
That clears it up. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

threads and extension module initialization

2008-03-28 Thread pianomaestro
I have an extension module that gets initialized multiple times because I am using threads. How can this module access global state (not per-thread state) ? It needs to create a singleton. Simon. -- http://mail.python.org/mailman/listinfo/python-list

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread pianomaestro
Did you try just creating a new socket every time you do a connect ? On Mar 28, 10:01 am, Jason Kristoff deevine-removethis- [EMAIL PROTECTED] wrote: I'm trying to make something that once it is disconnected will automatically try to reconnect. I'll add some more features in later so it

Re: Global variables in modules...

2008-03-28 Thread Terry Jones
Peter == Peter Otten [EMAIL PROTECTED] writes: Peter [EMAIL PROTECTED] wrote: [snip] ...can someone explain why invoking a.py prints 0? I would have thought that the global variable 'g' of module 'a' would be set to 1... Peter When you run a.py as a script it is put into the sys.modules

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread Laszlo Nagy
This is what I've got right now: #! /usr/bin/env python import socket, string sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def doconn(): sock.connect((localhost, 1234)) def dodiscon(): sock.close() doconn() doconn() while (1): buffer =

Setting the value of one cell in QTableWidget fills everything.

2008-03-28 Thread Constantly Distracted
I've just started PyQt programming and I've run into this little problem. When I set the text of one cell in my table, all the other cells fill with that value. All I wanted to do was run a loop, printing in each cell the row and column number. Here's the code. --

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 10:54:49 -0300, Clodoaldo [EMAIL PROTECTED] escribió: I'm using a md5 hash encoded with base64.urlsafe_b64encode as a parameter of a URL used to confirm a registration in a site. It has been working great. The url is like this:

ANN: Leo 4.4.8 b3 released

2008-03-28 Thread Edward K Ream
Leo 4.4.8 beta 3 is available at: http://sourceforge.net/project/showfiles.php?group_id=3458package_id=29106 This version features a new ipython plugin that provides a two-way bridge between Leo and IPython. See http://webpages.charter.net/edreamleo/IPythonBridge.html Leo is a text editor,

class or inherited list ?

2008-03-28 Thread Stef Mientki
hello, Passing all kinds of data between objects, I'm looking for an elegant (and simple) way to pack the data. Now it looks to me that both the class and the inherited list, performs equally well. Till now, the most elegant way (in my view) is the list inheritance, mainly because you don't need

Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 11:51:10 -0300, [EMAIL PROTECTED] escribió: I have an extension module that gets initialized multiple times because I am using threads. And do you want thread local variables? How can this module access global state (not per-thread state) ? It needs to create a

Pexpect question.

2008-03-28 Thread Paul Lemelle
I am trying separate a script that users pexpect into various functions within the same expect session. The problem is that the function does not return control back Main. Any insight into this issue would be greatly appreciated. Below is sample code of the problem. Thanks, Paul

Re: finding euclidean distance,better code?

2008-03-28 Thread harryos
The code is pretty legible as it is now. Anyway, using min() and a generator: hi is this calculated distance really Euclidean distance? When i checked wikipedia http://en.wikipedia.org/wiki/Euclidean_distance it shows a calculation involving sum of squares of the differences of elements.Here

Re: Setting the value of one cell in QTableWidget fills everything.

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:01:01 -0300, Constantly Distracted [EMAIL PROTECTED] escribió: I've just started PyQt programming and I've run into this little problem. When I set the text of one cell in my table, all the other cells fill with that value. def filltable(self):

Re: threads and extension module initialization

2008-03-28 Thread pianomaestro
On Mar 28, 11:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 11:51:10 -0300, [EMAIL PROTECTED] escribió: I have an extension module that gets initialized multiple times because I am using threads. And do you want thread local variables? no How can this module

Re: class or inherited list ?

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:15:45 -0300, Stef Mientki [EMAIL PROTECTED] escribió: Passing all kinds of data between objects, I'm looking for an elegant (and simple) way to pack the data. Now it looks to me that both the class and the inherited list, performs equally well. Till now, the most

web application-level caching

2008-03-28 Thread Chris Gray
Is there a Python module comparable in functionality to the PEAR Cache_Lite package for PHP? I've been doing some Googling to little avail. I'm experimenting with Python CGI to learn various techniques at a low level and I'm adapting a model that uses PHP. Any info about application-level

problem with CGIHTTPServer

2008-03-28 Thread 7stud
1) I have this simple cgi server: import CGIHTTPServer import BaseHTTPServer class MyRequestHandler(CGIHTTPServer.CGIHTTPRequestHandler): cgi_directories = ['/my_cgi_scripts'] server = BaseHTTPServer.HTTPServer( ('', 8111), MyRequestHandler ) server.serve_forever() 2)

Re: threads and extension module initialization

2008-03-28 Thread pianomaestro
On Mar 28, 11:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: C global variables are global, not per-thread. aha, a static pointer gets initialized to NULL, so I can check if it's not NULL in the module initializer. Thanks for jogging my brain, Simon. -- Gabriel Genellina --

Re: Summary of threading for experienced non-Python programmers?

2008-03-28 Thread Aahz
In article [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: I'm having trouble explaining the benefits and tradeoffs of threads to my coworkers and countering their misconceptions about Python's threading model and facilities. They all come from C++ and are used to thinking of multithreading as a

Re: Setting the value of one cell in QTableWidget fills everything.

2008-03-28 Thread Phil Thompson
On Friday 28 March 2008, Constantly Distracted wrote: I've just started PyQt programming and I've run into this little problem. When I set the text of one cell in my table, all the other cells fill with that value. ...because you have only created a single QTableWidgetItem instance, rather

Re: finding euclidean distance,better code?

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:15:48 -0300, harryos [EMAIL PROTECTED] escribió: The code is pretty legible as it is now. Anyway, using min() and a generator: hi is this calculated distance really Euclidean distance? When i checked wikipedia http://en.wikipedia.org/wiki/Euclidean_distance it

Re: finding euclidean distance,better code?

2008-03-28 Thread Robert Bossy
Gabriel Genellina wrote: That's what I said in another paragraph. sum of coordinates is using a different distance definition; it's the way you measure distance in a city with square blocks. I don't know if the distance itself has a name, but I think it is called Manhattan distance in

Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:25:55 -0300, [EMAIL PROTECTED] escribió: On Mar 28, 11:14 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 11:51:10 -0300, [EMAIL PROTECTED] escribió: How can this module access global state (not per-thread state) ? It needs to create a singleton.

Re: problem with CGIHTTPServer

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 12:38:45 -0300, 7stud [EMAIL PROTECTED] escribió: After I start the server script, load the html page in my browser, and click on the link, I get the desired output in my browser, but the server script outputs the following in my terminal: localhost - - [28/Mar/2008

Re: class or inherited list ?

2008-03-28 Thread Stef Mientki
thanks Gabriel, Gabriel Genellina wrote: En Fri, 28 Mar 2008 12:15:45 -0300, Stef Mientki [EMAIL PROTECTED] escribió: Passing all kinds of data between objects, I'm looking for an elegant (and simple) way to pack the data. Now it looks to me that both the class and the inherited list,

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread Grant Edwards
On 2008-03-28, Laszlo Nagy [EMAIL PROTECTED] wrote: while (1): buffer = sock.recv(1024) if not buffer: dodiscon() sock.recv(1024) can return zero bytes of data indicating that no data arrived yet. No, it can't. It does not mean that you have been disconnected.

Re: threads and extension module initialization

2008-03-28 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: I have an extension module that gets initialized multiple times because I am using threads. How can this module access global state (not per-thread state) ? It needs to create a singleton. The question is very unclear. If you are after *not* initializing your

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
On Mar 28, 12:09 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 10:54:49 -0300, Clodoaldo [EMAIL PROTECTED] escribió: I'm using a md5 hash encoded with base64.urlsafe_b64encode as a parameter of a URL used to confirm a registration in a site. It has been working

Re: SoC project: Python-Haskell bridge - request for feedback

2008-03-28 Thread Michał Janeczek
On 27 Mar 2008 23:49:46 -0700, Paul Rubin http://phr.cx@nospam.invalid wrote: Michaâ Janeczek [EMAIL PROTECTED] writes: However, the type of embedding that I imagined would be mostly pure functions, since Python can deal with IO rather well. It'd also be applicable in situations where we

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread Laszlo Nagy
Yes, that is exactly what it means. From the recv() man page: RETURN VALUE These calls return the number of bytes received, or -1 if an error occurred. The return value will be 0 when the peer has performed an orderly shutdown. Mea cupla. :-) What about

Re: threads and extension module initialization

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 13:17:44 -0300, Diez B. Roggisch [EMAIL PROTECTED] escribió: [EMAIL PROTECTED] schrieb: I have an extension module that gets initialized multiple times because I am using threads. How can this module access global state (not per-thread state) ? It needs to create a

Re: Summary of threading for experienced non-Python programmers?

2008-03-28 Thread Hrvoje Niksic
[EMAIL PROTECTED] writes: I'm having trouble explaining the benefits and tradeoffs of threads to my coworkers and countering their misconceptions about Python's threading model and facilities. They all come from C++ and are used to thinking of multithreading as a way to harness multiple CPU

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread Grant Edwards
On 2008-03-28, Laszlo Nagy [EMAIL PROTECTED] wrote: Yes, that is exactly what it means. From the recv() man page: RETURN VALUE These calls return the number of bytes received, or -1 if an error occurred. The return value will be 0 when the peer has performed an

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 13:22:06 -0300, Clodoaldo [EMAIL PROTECTED] escribió: On Mar 28, 12:09 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 10:54:49 -0300, Clodoaldo [EMAIL PROTECTED] escribió: What i need to know is where can an equal char appear in a

Re: Problem with write binary data to OLE field in Access

2008-03-28 Thread KingMax
On 3月27日, 下午7时22分, Tim Golden [EMAIL PROTECTED] wrote: lialie wrote: [... snip slightly confused indication that reading back a binary item using GetChunk appears to double its length ...] Well I don't know why this should be happening, but I do at least have a few suggestions: 1) Try

Re: How do I reconnect a disconnected socket?

2008-03-28 Thread Mike
On Mar 28, 10:01 am, Jason Kristoff deevine-removethis- [EMAIL PROTECTED] wrote: I'm trying to make something that once it is disconnected will automatically try to reconnect. I'll add some more features in later so it doesn't hammer the server but right now I just want to keep it simple and

Re: base64.urlsafe_b64encode and the equal character

2008-03-28 Thread Clodoaldo
On Mar 28, 1:56 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 13:22:06 -0300, Clodoaldo [EMAIL PROTECTED] escribió: On Mar 28, 12:09 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 10:54:49 -0300, Clodoaldo [EMAIL PROTECTED] escribió: What i

Re: Summary of threading for experienced non-Python programmers?

2008-03-28 Thread Diez B. Roggisch
systems. (In theory, file input/output should also be available as asynchronous code, but async IO is low-level and not available in Python.) While threads shouldn't be considered a replacement for I suggest you tell that the twisted-guys. And the ones from the built-in asyncore-module.

Re: Summary of threading for experienced non-Python programmers?

2008-03-28 Thread sturlamolden
On 28 Mar, 15:52, [EMAIL PROTECTED] wrote: I'm having trouble explaining the benefits and tradeoffs of threads to my coworkers and countering their misconceptions about Python's threading model and facilities.   Python's threading module is modelled on Java's thread model. There are some

Re: class or inherited list ?

2008-03-28 Thread Stef Mientki
class super_list(list): pass def kwadraat ( value ) : return value * value x={} x['frequency']=33 x['functie']=kwadraat print x['functie'](2) y = super_list() y.frequency = 33 y.functie = kwadraat print y.functie(3) You don't use y as a list at all - you might as

Re: Psyco alternative

2008-03-28 Thread Paul Boddie
On 27 Mar, 15:19, Diez B. Roggisch [EMAIL PROTECTED] wrote: [Psyco maintenance and further development] Nope, but I heard through the grapevine that while it won't be supported for all times to come, a new version is in the making. But ultimately, the author says that the approach is

Astronomy Fits format and gif.save(path)

2008-03-28 Thread W. Watson
In what library would I find gif.save(path), where path is the name and path of a file, and the method would produce a file in a gif format? Is there a fits.save(path) somewhere? fits is commonly used in astronomical work. -- Wayne Watson (Nevada City, CA)

Re: Instrumented web proxy

2008-03-28 Thread Andrew McLean
Paul Rubin wrote: Andrew McLean [EMAIL PROTECTED] writes: I would like to write a web (http) proxy which I can instrument to automatically extract information from certain web sites as I browse them. Specifically, I would want to process URLs that match a particular regexp. For those URLs I

Re: Summary of threading for experienced non-Python programmers?

2008-03-28 Thread Donn Cave
In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: systems. (In theory, file input/output should also be available as asynchronous code, but async IO is low-level and not available in Python.) While threads shouldn't be considered a replacement for I suggest you

Re: Dynamic code problem

2008-03-28 Thread castironpi
On Mar 28, 8:41 am, Gabriel Genellina [EMAIL PROTECTED] wrote: En Fri, 28 Mar 2008 07:14:17 -0300, Simon Brunning   [EMAIL PROTECTED] escribió: On Thu, Mar 27, 2008 at 4:13 PM,  [EMAIL PROTECTED] wrote: My dynamic code failed at this site http:///, need  some help thank you.

Installing simplejson issues

2008-03-28 Thread blwatson
I am trying to install the twitter python wrapper...I got that installed just fine, but am having serious troubles getting the simplejson package to install. I need help diagnosing where this is failing. I am trying to use: http://pypi.python.org/pypi/simplejson and I run python setup.py build

Re: Advantage of the array module over lists?

2008-03-28 Thread Piet Delport
On Mar 17, 1:49 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: I doubt that. AFAIK both arrays and lists are continuous memory-areas, that double (at least to a certain threshold or so) when reaching the capacity limit. For what it's worth, lists over-allocate by ~1/8, and arrays by ~1/16.

Re: how to capture screenshots of the active window in Python

2008-03-28 Thread Colin J. Williams
Gabriel Genellina wrote: En Thu, 27 Mar 2008 20:28:27 -0300, Praveena B [EMAIL PROTECTED] escribió: Can anyone help me out?? Still lacking details... PIL has a ImageGrab module, Windows only. For Windows, Alt Prtscn usually copies the image to a clipboard. Colin W. --

Re: finding euclidean distance,better code?

2008-03-28 Thread castironpi
On Mar 28, 10:15 am, harryos [EMAIL PROTECTED] wrote: The code is pretty legible as it is now. Anyway, using min() and a generator: hi is this calculated distance really Euclidean distance? When i checked wikipediahttp://en.wikipedia.org/wiki/Euclidean_distance it shows a calculation

Finding Full Path to Process EXE

2008-03-28 Thread misceverything
Hello, I would like to write a script that would enumerate all running processes and return the full path to the EXE of each running process. However, I can't seem to find any good info on how to do this..any help is greatly appreciated. Thanks. T --

Question regd downloading multipart mail using POP3

2008-03-28 Thread SPJ
I am facing a strange problem when I am trying to retrieve multipart mail from POP server with attachments. The task is to write a script which will retrieve mail with specific 'from' field. Get the subject, body and attachments if any and reuse this info to send mail with different format to

Problem with format string and unicode

2008-03-28 Thread Hans Martin
Hi, this is probably a trivial problem, but a google search for python and unicode and format string gives too many hits: If I specify e.g. %20s in a format string and the string value contains UTF-8 stuff (differing number of bytes per character), the length of the resulting string (in

Python 2.5 - Build Error on Windows because of SQLite3

2008-03-28 Thread llothar
Why does Python2.5 do not include the amalgamation source code of sqlite3? At the moment it is not possible to build the system out of the box with the Visual Studio project. I don't think this is good. The amalgamation version is exactly for this purpose. Is there a 2.5.3 release on the way? --

Re: Astronomy Fits format and gif.save(path)

2008-03-28 Thread Gary Herron
W. Watson wrote: In what library would I find gif.save(path), where path is the name and path of a file, and the method would produce a file in a gif format? Is there a fits.save(path) somewhere? fits is commonly used in astronomical work. You may want to install PIL (the Python Image

Re: Problem with format string and unicode

2008-03-28 Thread Marc 'BlackJack' Rintsch
On Fri, 28 Mar 2008 21:13:00 +0100, Hans Martin wrote: this is probably a trivial problem, but a google search for python and unicode and format string gives too many hits: If I specify e.g. %20s in a format string and the string value contains UTF-8 stuff (differing number of bytes per

Re: Installing simplejson issues

2008-03-28 Thread Gabriel Genellina
En Fri, 28 Mar 2008 16:14:07 -0300, [EMAIL PROTECTED] escribió: I am trying to install the twitter python wrapper...I got that installed just fine, but am having serious troubles getting the simplejson package to install. I need help diagnosing where this is failing. I am trying to use:

Tell ya' what:

2008-03-28 Thread castironpi
I want to regression a signal. It's NN, not necessarily, sine wave. What kind of numbers of harmonic simultaneous sounds are we looking at? How close to an A 440 can a human make? I want recognition to alert me. As a sine wave is coming in: for t in [ ( 200* sin( x*2 ), 200* cos( x*2 ) ) for

How to insert multiple rows in SQLite Dbase

2008-03-28 Thread afandi
Hi, Generally, it involves SQL statement such as follow INSERT INTO tablename(field1,field2,...fieldn) VALUES ('abc','def'...) If I have data taken from Apache Server Log,let say 100 lines which is printed output of 8 fields such as: data 1 IP: 61.5.65.101 Date: 26/Sep/2007

Re: finding euclidean distance,better code?

2008-03-28 Thread harryos
the norm from which it is derived is called norm-1, or L1; the usual euclidean distance is derived from norm-2. If you only want to see if two things are close enough, this provides a faster measure than the euclidean distance. thanks Gabriel for the detailed explanation.. if i were to

Re: Python 2.5 - Build Error on Windows because of SQLite3

2008-03-28 Thread Gerhard Häring
llothar wrote: Why does Python2.5 do not include the amalgamation source code of sqlite3? [...] First, at the time Python grew the sqlite3 module, there was no amalgamation yet. My reasoning: So that Python doesn't need to release a security release, should a security bug in SQLite be found.

Re: Tell ya' what:

2008-03-28 Thread Grant Edwards
On 2008-03-28, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Did everyone take the course on computer architecture? No. I personally know dozens of people who didn't. And I know others who took a course on computer architecture but not the course on computer architecture. -- Grant Edwards

Class or dictionary ? (was: class or inherited list ?)

2008-03-28 Thread Stef Mientki
Sorry, although the code example was correct, the question was wrong. Stef Mientki Stef Mientki wrote: hello, Passing all kinds of data between objects, I'm looking for an elegant (and simple) way to pack the data. Now it looks to me that both the class and the inherited list, performs

Re: Finding Full Path to Process EXE

2008-03-28 Thread Tim Golden
[EMAIL PROTECTED] wrote: Hello, I would like to write a script that would enumerate all running processes and return the full path to the EXE of each running process. However, I can't seem to find any good info on how to do this..any help is greatly appreciated. Thanks. I have this

Re: Tell ya' what:

2008-03-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: Did everyone take the course on computer architecture? Yow! Does your SPEED QUEEN have CABLE? -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >