Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
> >> Note that the thread acquires the lock ONCE, repeats several thousand > >> times an assignment to a *local* variable called GLOBAL_VAR (!), finally > >> releases the lock and exits. As every thread does the same, they just   > >> run > >> one after another, they never have a significant overl

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
> >> Note that the thread acquires the lock ONCE, repeats several thousand > >> times an assignment to a *local* variable called GLOBAL_VAR (!), finally > >> releases the lock and exits. As every thread does the same, they just   > >> run > >> one after another, they never have a significant overl

Re: How do I DRY the following code?

2008-12-30 Thread Steven D'Aprano
On Mon, 29 Dec 2008 21:13:55 -0500, R. Bernstein wrote: > How do I DRY the following code? > > class C(): [snip code] Move the common stuff into methods (or possibly external functions). If you really need to, make them private by appending an underscore to the front of the name. class C():

Re: wxPython.button.disabled still catching clicks

2008-12-30 Thread mynthon
On Dec 23, 6:12 pm, Mike Driscoll wrote: > On Dec 23, 7:27 am,mynthon wrote: > > > > > On Dec 23, 11:58 am, Aaron Brady wrote: > > > > On Dec 23, 4:50 am,mynthon wrote: > > > > > Hello! (sorry for my english) > > > > > I have a problem with buttons in wxPython. When button is disabled > > > > (by

Re: get method

2008-12-30 Thread Roel Schroeven
James Mills schreef: > Ross, the others have informed you that you are not > actually incrementing the count. I'll assume you've > fixed your function now :) ... I want to show you a far > simpler way to do this which takes advantage of > Python's list comprehensions and mappings (which are > reall

Re: How to debug embeding Python?

2008-12-30 Thread weir009
Using udp to send out message is a convenient way, you may define a log function like following, and start a udp server to lisen. # from socket import * udpSock = socket(AF_INET,SOCK_DGRAM) def log(s): udpSock.sendto(s, ('127.0.0.1', 514)) log('hello') -- http://mail.python.

Re: SQL, lite lite lite

2008-12-30 Thread Bruno Desthuilliers
Johannes Bauer a écrit : (snip) Even if it took (as you mentioned) a semester of SQL studies - which it does not - why do you think your syntax is easier? The only person your proposed syntax is easier for is you. Get over it, learn SQL, and enjoy the benefits of one unified standard - not everyo

Re: How do I DRY the following code?

2008-12-30 Thread R. Bernstein
Steven D'Aprano writes: > On Mon, 29 Dec 2008 21:13:55 -0500, R. Bernstein wrote: > >> How do I DRY the following code? >> >> class C(): > [snip code] > > Move the common stuff into methods (or possibly external functions). If > you really need to, make them private by appending an underscore t

Re: How do I DRY the following code?

2008-12-30 Thread R. Bernstein
"Patrick Mullen" writes: >> f1(...): >> "Docstring f1" >> c = C() >> return c.f1(...) >> >> f2(...): >> "Docstring f2" >> c = C() >> return c.f2(...) > > Why not just do either this: > C().f2(..) where you need f2 Yes, this is a little better. Thanks! -- http://mail.python.org/mailman/listi

string in files

2008-12-30 Thread ibpet11
guys i need info on how to call up different words in a line of a file using python example : file = 'this is a python coding group' i want to assign a xter to this, is, a, python , coding and group thanks -- http://mail.python.org/mailman/listinfo/python-list

RE: string in files

2008-12-30 Thread Narasimhan Raghu-RBQG84
Simple solution: us result=yourString.split(" ") and you get a list with all the words. -Original Message- From: python-list-bounces+rbqg84=motorola@python.org [mailto:python-list-bounces+rbqg84=motorola@python.org] On Behalf Of ibpe...@gmail.com Sent: Tuesday, December 30, 2008 3

Re: string in files

2008-12-30 Thread ibpet11
On Dec 30, 11:17 am, "Narasimhan Raghu-RBQG84" wrote: > Simple solution: us result=yourString.split(" ") and you get a list with > all the words. > > -Original Message- > From: python-list-bounces+rbqg84=motorola@python.org > > [mailto:python-list-bounces+rbqg84=motorola@python.org

using def in pythons

2008-12-30 Thread ibpet11
hi, i want to have a broad knowledge on the use of "def" in python as i know i might need it to my string handling and for a lot of things in general. I will really appreciate anybody who can support my mission of becoming a python Programmer as per constant chatting and support or manuals to rea

Re: string in files

2008-12-30 Thread Glauco
thanks brother i mean how do i particularly assign (u = this) (y = is) in the strings up there. i have been able to split strings with any character sign. If i'm not wrong this is simple with RE: In [1]: st = 'this is a python coding group' In [2]: i

Re: Python in C

2008-12-30 Thread skip
aki> Although this is not what you are asking but I'm wondering why you aki> need to read CPython implementation. A couple reasons come to mind: * education * want to make it better (extend it, fix bugs, etc) * want to see how it relates to the implementation of other langua

Re: using def in pythons

2008-12-30 Thread Sreenivas
On Dec 30, 3:37 pm, ibpe...@gmail.com wrote: > hi, > > i want to have a broad knowledge on the use of "def" in python as i > know i might need it > to my string handling and for a lot of things in general. > > I will really appreciate anybody who can support my mission of > becoming a python Progra

Re: string in files

2008-12-30 Thread Steve Holden
ibpe...@gmail.com wrote: > On Dec 30, 11:17 am, "Narasimhan Raghu-RBQG84" > wrote: >> Simple solution: us result=yourString.split(" ") and you get a list with >> all the words. >> >> -Original Message- >> From: python-list-bounces+rbqg84=motorola@python.org >> >> [mailto:python-list-bo

Re: string in files

2008-12-30 Thread Lie Ryan
On Tue, 30 Dec 2008 11:53:17 +0100, Glauco wrote: >> thanks brother >> i mean how do i particularly assign (u = this) >> (y = is) >> in the strings up there. i have been able to split strings with any >> character sign. >> >> > > If i'm not wrong this is

Re: Any equivalent to Ruby's 'hpricot' html/xpath/css selector package?

2008-12-30 Thread Stefan Behnel
Mark Thomas wrote: > The main difference is that lxml doesn't have CSS selector syntax Feel free to read the docs: http://codespeak.net/lxml/cssselect.html Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Any equivalent to Ruby's 'hpricot' html/xpath/css selector package?

2008-12-30 Thread Stefan Behnel
Bruno Desthuilliers wrote: >> However, what makes it really useful is that it does a good job of >> handling the "broken" html that is so commonly found on the web. > > BeautifulSoup ? > http://pypi.python.org/pypi/BeautifulSoup/3.0.7a > > possibly with ElementSoup ? > http://pypi.python.org/pypi

Re: Any equivalent to Ruby's 'hpricot' html/xpath/css selector package?

2008-12-30 Thread Stefan Behnel
Kenneth McDonald wrote: > Ruby has a package called 'hpricot' which can perform limited xpath > queries, and CSS selector queries. However, what makes it really useful > is that it does a good job of handling the "broken" html that is so > commonly found on the web. Does Python have anything simila

Re: How to debug embeding Python?

2008-12-30 Thread Diez B. Roggisch
Hongtian schrieb: Hi Friends, My application is written in C/C++ and Python is embed to extend some functions (several .py files are invoked). But I am confused how to debug these embed Python? Can I use 'print-debuging'? and where can I capture the output string? Or Python can support 'break'

Re: Any equivalent to Ruby's 'hpricot' html/xpath/css selector package?

2008-12-30 Thread Mark Thomas
On Dec 30, 8:20 am, Stefan Behnel wrote: > Mark Thomas wrote: > > The main difference is that lxml doesn't have CSS selector syntax > > Feel free to read the docs: > > http://codespeak.net/lxml/cssselect.html Don't know how I missed that... So lxml is pretty much an exact equivalent to what Ruby

Triple quoted string in exec function ?

2008-12-30 Thread Stef Mientki
hello, I'm running scripts, with the execute function (Python 2.5), and it seems that triple quoted strings are not allowed. Is there a workaround, or is this a fundamental problem of the exec-function ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

select.select and socket.setblocking

2008-12-30 Thread Laszlo Nagy
I'm using this method to read from a socket: def read_data(self,size): """Read data from connection until a given size.""" res = "" fd = self.socket.fileno() while not self.stop_requested.isSet(): remaining = size - len(res) if remaining<=0:

Re: Triple quoted string in exec function ?

2008-12-30 Thread Steve Holden
Stef Mientki wrote: > hello, > > I'm running scripts, with the execute function (Python 2.5), > and it seems that triple quoted strings are not allowed. > > Is there a workaround, > or is this a fundamental problem of the exec-function ? > If you think about it, it should be obvious that you can

Python list's mail server in DNSBL ?

2008-12-30 Thread Laszlo Nagy
I got this message when I tried to send something to this list, through my ISP's SMTP server: This Message was undeliverable due to the following reason: Each of the following recipients was rejected by a remote mail server. The reasons given by the server are included to help you determine w

Re: select.select and socket.setblocking

2008-12-30 Thread Steve Holden
Laszlo Nagy wrote: > I'm using this method to read from a socket: > >def read_data(self,size): >"""Read data from connection until a given size.""" >res = "" >fd = self.socket.fileno() >while not self.stop_requested.isSet(): >remaining = size - len(r

Re: Python list's mail server in DNSBL ?

2008-12-30 Thread Steve Holden
Laszlo: Read the message again. There's nothing the list admins can do about this, you'll have to contact postmas...@chello.at to have them remove the blacklisting, since it's their server that's imposing it. regards Steve Laszlo Nagy wrote: > I got this message when I tried to send something t

[ANN] release of CubicWeb 3.0.0

2008-12-30 Thread nchauvat (Logilab)
The development team is pleased to announce the release of CubicWeb 3.0.0 (nicknamed ShowTime). What is CubicWeb? - With CubicWeb, the Semantic Web is a construction game! CubicWeb_ is a semantic web application framework, licensed under the LGPL, that empowers developers to effi

Re: Python module import loop issue

2008-12-30 Thread Gabriel Genellina
En Tue, 30 Dec 2008 01:32:48 -0200, Carl Banks escribió: Gabriel Genellina wrote: A problem with metaclasses is when you have intermediate subclasses that are not meant to be registered, but the metaclass applies equally to all of them. Not the way I wrote it. If you'll note, the metaclas

Re: why cannot assign to function call

2008-12-30 Thread John O'Hagan
On Tue, 30 Dec 2008, Aaron Brady wrote: [...] > On a technicality, to avert a flaming, "change the value of 'b'" is an > ambiguous phrase. There are two interpretations of "change what 'b' > refers to" and "change what 'b' refers to". Even in spoken language, > I don't think that emphasis can resol

Re: multiprocessing vs thread performance

2008-12-30 Thread Aaron Brady
On Dec 29, 9:08 pm, "James Mills" wrote: > On Tue, Dec 30, 2008 at 12:52 PM, Aaron Brady wrote: > > On Dec 29, 7:40 pm, "James Mills" > > wrote: > >> On Tue, Dec 30, 2008 at 11:34 AM, Aaron Brady wrote: > >> > The OP may be interested in Erlang, which Wikipedia (end-all, be-all) > >> > claims i

Re: Python list's mail server in DNSBL ?

2008-12-30 Thread Laszlo Nagy
Steve Holden wrote: Laszlo: Read the message again. There's nothing the list admins can do about this, you'll have to contact postmas...@chello.at to have them remove the blacklisting, since it's their server that's imposing it. Maybe it is my bad English but this part: Ask your > Mail-/DN

Re: Python list's mail server in DNSBL ?

2008-12-30 Thread skip
>> > Ask your Mail-/DNS-Administrator to correct HELO and DNS MX >> > settings and to get removed from DNSBLs; in >> > bogusmx.rfc-ignorant.org >> > >> > >> > Please reply to if you feel this message to >> > be in error. I went to rfc-ignorant.org and looked up pyth

Re: Triple quoted string in exec function ?

2008-12-30 Thread ibpet11
On Dec 30, 2:48 pm, Steve Holden wrote: > Stef Mientki wrote: > > hello, > > > I'm running scripts, with the execute function (Python 2.5), > > and it seems that triple quoted strings are not allowed. > > > Is there a workaround, > > or is this a fundamental problem of the exec-function ? > > If y

thread, multiprocessing: communication overhead

2008-12-30 Thread mk
Hello everyone, This time I decided to test communication overhead in multithreaded / multiprocess communication. The results are rather disappointing, that is, communication overhead seems to be very high. In each of the following functions, I send 10,000 numbers to the function / 10 threads

Re: why cannot assign to function call

2008-12-30 Thread Aaron Brady
On Dec 30, 8:21 am, John O'Hagan wrote: > On Tue, 30 Dec 2008, Aaron Brady wrote: > > [...] > > > On a technicality, to avert a flaming, "change the value of 'b'" is an > > ambiguous phrase. There are two interpretations of "change what 'b' > > refers to" and "change what 'b' refers to". Even in s

Parsing Excel spreadsheets

2008-12-30 Thread andyh...@gmail.com
Hi, Can anybody recommend an approach for loading and parsing Excel spreadsheets in Python. Any well known/recommended libraries for this? The only thing I found in a brief search was http://www.lexicon.net/sjmachin/xlrd.htm, but I'd rather get some more input before going with something I don't

Re: thread, multiprocessing: communication overhead

2008-12-30 Thread Aaron Brady
On Dec 30, 9:46 am, mk wrote: > Hello everyone, > > This time I decided to test communication overhead in multithreaded / > multiprocess communication. The results are rather disappointing, that > is, communication overhead seems to be very high. In each of the > following functions, I send 10,000

Re: Parsing Excel spreadsheets

2008-12-30 Thread r
On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: > Hi, > > Can anybody recommend an approach for loading and parsing Excel > spreadsheets in Python. Any well known/recommended libraries for this? > > The only thing I found in a brief search > washttp://www.lexicon.net/sjmachin/xlrd.htm, > but I'd

Re: thread, multiprocessing: communication overhead

2008-12-30 Thread mk
Aaron Brady wrote: snips def threadsemfun(): sem = threading.Semaphore() def threadlockfun(): sem = threading.Semaphore() You used a Semaphore for both lock objects here. Right... I corrected that (simply changed to threading.Lock() in threadlockfun) and the result is muc

Re: thread, multiprocessing: communication overhead

2008-12-30 Thread Duncan Booth
mk wrote: > This time I decided to test communication overhead in multithreaded / > multiprocess communication. The results are rather disappointing, that > is, communication overhead seems to be very high. In each of the > following functions, I send 10,000 numbers to the function / 10 thread

Re: Python in C

2008-12-30 Thread akineko
Hello Skip, Thank you for your response. Your posting reminds me that we, Python community as a whole, owe a great deal to Python developers. The problem is ... The more you work on Python, the harder you can go back to C or C++ world. I use SWIG, instead. I think SWIG is a good way to mix two w

Re: SQL, lite lite lite

2008-12-30 Thread pruebauno
On Dec 29, 1:06 pm, Aaron Brady wrote: > Hi all, > > About a year ago, I posted an idea I was having about thread > synchronization to the newsgroup.  However, I did not explain it well, > and I really erred on the side of brevity.  (After some finagling, Mr. > Bieber and I decided it wasn't exact

Re: Parsing Excel spreadsheets

2008-12-30 Thread Tino Wildenhain
r wrote: On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: Hi, Can anybody recommend an approach for loading and parsing Excel spreadsheets in Python. Any well known/recommended libraries for this? The only thing I found in a brief search washttp://www.lexicon.net/sjmachin/xlrd.htm, but I'd r

python import sys.path

2008-12-30 Thread Kelly, Brian
I have both 2.4 and 2.5 interpreters installed on a linux box. The PythonPath is set to : PYTHONPATH=/usr/lib64/portage/pym:/prod/bacula/local/lib64/python2.4/site-pa ckages:/prod/bacula/local/lib/python2.4/site-packages My main script is getting called like so: python2.4 cleanup.py wrkstnbs Th

Re: select.select and socket.setblocking

2008-12-30 Thread Francesco Bochicchio
Laszlo Nagy ha scritto: I'm using this method to read from a socket: def read_data(self,size): """Read data from connection until a given size.""" res = "" fd = self.socket.fileno() while not self.stop_requested.isSet(): remaining = size - len(res)

duck typing at will

2008-12-30 Thread Jose Mora
Duck typing is called that way because "If it looks like a duck and quacks like a duck, it must be a duck." I think it would be good to have also "If the programmer wants to deal with it like a duck, it must be a duck" I mean, some tasks are rather boring in python when compared with php, for exam

Re: wxPython.button.disabled still catching clicks

2008-12-30 Thread Mike Driscoll
On Dec 30, 3:04 am, mynthon wrote: > On Dec 23, 6:12 pm, Mike Driscoll wrote: > > > > > On Dec 23, 7:27 am,mynthon wrote: > > > > On Dec 23, 11:58 am, Aaron Brady wrote: > > > > > On Dec 23, 4:50 am,mynthon wrote: > > > > > > Hello! (sorry for my english) > > > > > > I have a problem with button

Re: Parsing Excel spreadsheets

2008-12-30 Thread Steve Holden
Tino Wildenhain wrote: > r wrote: >> On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: >>> Hi, >>> >>> Can anybody recommend an approach for loading and parsing Excel >>> spreadsheets in Python. Any well known/recommended libraries for this? >>> >>> The only thing I found in a brief search >>> wash

Re: folder extraction

2008-12-30 Thread Mike Driscoll
On Dec 30, 9:30 am, ibpe...@gmail.com wrote: > how do i get along with this task of extracting multiples folder and > generating their names individually in a their respective files as > they were generated. Are you talking about unzipping an archive or walking a directory? If the former, see the

Re: Parsing Excel spreadsheets

2008-12-30 Thread Mike Driscoll
On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: > Hi, > > Can anybody recommend an approach for loading and parsing Excel > spreadsheets in Python. Any well known/recommended libraries for this? > > The only thing I found in a brief search > washttp://www.lexicon.net/sjmachin/xlrd.htm, > but I'd

Re: duck typing at will

2008-12-30 Thread MRAB
Jose Mora wrote: Duck typing is called that way because "If it looks like a duck and quacks like a duck, it must be a duck." I think it would be good to have also "If the programmer wants to deal with it like a duck, it must be a duck" I mean, some tasks are rather boring in python when compared

Re: duck typing at will

2008-12-30 Thread Ned Deily
In article <6e1bfdea0812301042x70ab57capf99ce73d364d5...@mail.gmail.com>, "Jose Mora" wrote: >[...] > I mean, some tasks are rather boring in python when compared with php, > for example, let's imagine we have a dictionary that contains > dictionaries that contain the times that a key appears. W

Re: SQL, lite lite lite

2008-12-30 Thread Aaron Brady
On Dec 30, 11:16 am, prueba...@latinmail.com wrote: > On Dec 29, 1:06 pm, Aaron Brady wrote: snip > > My idea is to create a 'Relation' class.  The details are basically > > open, such as whether to back it with 'sqllite3', 'shelve', 'mmap', or > > just mapping and sequence objects; what the simpl

Re: select.select and socket.setblocking

2008-12-30 Thread Jean-Paul Calderone
On Tue, 30 Dec 2008 19:19:08 +0100, Francesco Bochicchio wrote: [snip] If you are interested in socket errors, you should also fill the third 'fd-set' in the select call, and after select returns check that fd is not in it anymore: ready = select.select( [fd],[], [fd] ) if fd in ready[2]:

need help with list/variables

2008-12-30 Thread wx1234
I have a list and would like to parse the list appending each list item to the end of a variable on a new line. for instance mylist = ['something\n', 'another something\n', 'something again\n'] then parse mylist to make it appear in my variable in this format: myvar = """ something another some

Re: thread, multiprocessing: communication overhead

2008-12-30 Thread Duncan Booth
mk wrote: >> CMIIW, but I believe your timing function includes the time to launch >> the actual processes and threads, create the synch. objects, etc. You >> might try it again, creating them first, starting the timer, then >> loading them. > > Except I don't know how to do that using timeit.T

Re: need help with list/variables

2008-12-30 Thread 5lvqbwl02
On Dec 30, 11:31 am, wx1...@gmail.com wrote: > I have a list and would like to parse the list appending each list > item to the end of a variable on a new line. > > for instance > > mylist = ['something\n', 'another something\n', 'something again\n'] > > then parse mylist to make it appear in my va

Re: need help with list/variables

2008-12-30 Thread Tim Chase
I have a list and would like to parse the list appending each list item to the end of a variable on a new line. for instance mylist = ['something\n', 'another something\n', 'something again\n'] then parse mylist to make it appear in my variable in this format: myvar = """ something another som

embedding python in wxpython

2008-12-30 Thread 5lvqbwl02
Hi, I've looked around for a way to allow a python console from within a wxPython application, but have only found stuff on embedded/ extending python with C/C++ or wxWidgets in C++, but not wxPython. Is this easy to do? Can someone point me in the right direction? Also, typically when you embed

Re: duck typing at will

2008-12-30 Thread Bruno Desthuilliers
Jose Mora a écrit : Duck typing is called that way because "If it looks like a duck and quacks like a duck, it must be a duck." or at least something close enough... I think it would be good to have also "If the programmer wants to deal with it like a duck, it must be a duck" DWIM[1] just d

Re: need help with list/variables

2008-12-30 Thread Albert Hopkins
On Tue, 2008-12-30 at 11:31 -0800, wx1...@gmail.com wrote: > I have a list and would like to parse the list appending each list > item to the end of a variable on a new line. > > for instance > > mylist = ['something\n', 'another something\n', 'something again\n'] > > then parse mylist to make i

Re: embedding python in wxpython

2008-12-30 Thread Mike Driscoll
On Dec 30, 1:52 pm, 5lvqbw...@sneakemail.com wrote: > Hi, I've looked around for a way to allow a python console from within > a wxPython application, but have only found stuff on embedded/ > extending python with C/C++ or wxWidgets in C++, but not wxPython. > > Is this easy to do?  Can someone poi

Re: Triple quoted string in exec function ?

2008-12-30 Thread Stef Mientki
ibpe...@gmail.com wrote: On Dec 30, 2:48 pm, Steve Holden wrote: Stef Mientki wrote: hello, I'm running scripts, with the execute function (Python 2.5), and it seems that triple quoted strings are not allowed. Is there a workaround, or is this a fundamental problem of t

Re: embedding python in wxpython

2008-12-30 Thread Stef Mientki
5lvqbw...@sneakemail.com wrote: Hi, I've looked around for a way to allow a python console from within a wxPython application, but have only found stuff on embedded/ extending python with C/C++ or wxWidgets in C++, but not wxPython. Is this easy to do? Can someone point me in the right directio

Re: Triple quoted string in exec function ?

2008-12-30 Thread Jean-Paul Calderone
On Tue, 30 Dec 2008 21:16:39 +0100, Stef Mientki wrote: ibpe...@gmail.com wrote: On Dec 30, 2:48 pm, Steve Holden wrote: Stef Mientki wrote: hello, I'm running scripts, with the execute function (Python 2.5), and it seems that triple quoted strings are not allowed. Is there a w

Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread 5lvqbwl02
I have Section 4.4.1 of SICP rattling around in my head (database queries), and I'm trying to come up with a simple dictionary-based database in Python to represent circuit diagrams. My main confusion isn't one of implementation, but a matter of "big thinking", fundamentally, about the problem. Pl

Re: PIL - font kerning

2008-12-30 Thread carsn
On Dec 23, 9:51 pm, Ivan Illarionov wrote: > On Dec 23, 11:22 pm, Ivan Illarionov > wrote: > > > > > On 23 дек, 16:44, carsn wrote: > > > > Hey all, > > > > anybody know, if there´s a way to specify the kerning of a font, when > > > you draw text withPIL? > > > > I´d like to achieve the same eff

Re: select.select and socket.setblocking

2008-12-30 Thread Grant Edwards
On 2008-12-30, Francesco Bochicchio wrote: > 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in > select between blocking and non-blocking mode. The difference is in the > recv (again, assuming that you use TCP as protocol, that is AF_INET, > SOCK_STREAM), which in the block

Re: select.select and socket.setblocking

2008-12-30 Thread Jean-Paul Calderone
On Tue, 30 Dec 2008 14:41:17 -0600, Grant Edwards wrote: On 2008-12-30, Francesco Bochicchio wrote: 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in select between blocking and non-blocking mode. The difference is in the recv (again, assuming that you use TCP as protocol

Re: select.select and socket.setblocking

2008-12-30 Thread Jean-Paul Calderone
On Tue, 30 Dec 2008 15:55:51 -0500, Jean-Paul Calderone wrote: On Tue, 30 Dec 2008 14:41:17 -0600, Grant Edwards wrote: On 2008-12-30, Francesco Bochicchio wrote: 3. AFAIK (sorry, I feel acronym-ly today ;), there is no difference in select between blocking and non-blocking mode. The differ

Re: SQL, lite lite lite

2008-12-30 Thread Gerhard Häring
Bruno Desthuilliers wrote: Aaron Brady a écrit : Hi all, (snip) > I don't think relational data can be read and written very easily in Python. Did you try SQLAlchemy or Django's ORM ? [...] Using an ORM when you don't grasp the relational model and/or the SQL query language is futile.

Re: embedding python in wxpython

2008-12-30 Thread Jervis Whitley
On Wed, Dec 31, 2008 at 7:21 AM, Stef Mientki wrote: > 5lvqbw...@sneakemail.com wrote: > >> Hi, I've looked around for a way to allow a python console from within >> a wxPython application, but have only found stuff on embedded/ >> extending python with C/C++ or wxWidgets in C++, but not wxPython.

Re: Triple quoted string in exec function ?

2008-12-30 Thread Steve Holden
Stef Mientki wrote: > ibpe...@gmail.com wrote: >> On Dec 30, 2:48 pm, Steve Holden wrote: >> >>> Stef Mientki wrote: >>> hello, I'm running scripts, with the execute function (Python 2.5), and it seems that triple quoted strings are not allowed. Is there a wor

Re: Triple quoted string in exec function ?

2008-12-30 Thread Rob Williscroft
Stef Mientki wrote in news:mailman.6399.1230668197.3487.python- l...@python.org in comp.lang.python: >>> And, by the way, exec is a *statement*, not a function! >>> > exec ( Init_Code, PG.P_Globals ) > > I've really doubt that this is a statement, > unless I don't understand what a sta

Re: embedding python in wxpython

2008-12-30 Thread Steve Holden
5lvqbw...@sneakemail.com wrote: > Hi, I've looked around for a way to allow a python console from within > a wxPython application, but have only found stuff on embedded/ > extending python with C/C++ or wxWidgets in C++, but not wxPython. > > Is this easy to do? Can someone point me in the right

Re: win32gui

2008-12-30 Thread Mike Driscoll
On Dec 30, 3:22 pm, Gandalf wrote: > I'm searching the win32gui hooks for a function to get the windowClass > position any idea? > > thanks! Try looking in the docs: http://docs.activestate.com/activepython/2.4/pywin32/win32gui.html I think the GetWindowPlacement() might be what you're looking

Re: SQL, lite lite lite

2008-12-30 Thread Bruno Desthuilliers
Gerhard Häring a écrit : Bruno Desthuilliers wrote: Aaron Brady a écrit : Hi all, (snip) > I don't think relational data can be read and written very easily in Python. Did you try SQLAlchemy or Django's ORM ? [...] Using an ORM when you don't grasp the relational model and/or the SQL

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread Jonathan Gardner
On Dec 30, 12:35 pm, 5lvqbw...@sneakemail.com wrote: > I have Section 4.4.1 of SICP rattling around in my head (database > queries), and I'm trying to come up with a simple dictionary-based > database in Python to represent circuit diagrams.  My main confusion > isn't one of implementation, but a m

Re: SQL, lite lite lite

2008-12-30 Thread Bruno Desthuilliers
Aaron Brady a écrit : On Dec 30, 11:16 am, prueba...@latinmail.com wrote: (snip) You really do like to reinvent the wheels do you? :-) Nothing wrong with that. Just be aware that most people that really need what you are proposing are probably already using mature feature rich libraries for tha

Re: Parsing Excel spreadsheets

2008-12-30 Thread John Machin
On Dec 31, 5:48 am, Mike Driscoll wrote: > On Dec 30, 10:07 am, "andyh...@gmail.com" wrote: > > > Hi, > > > Can anybody recommend an approach for loading and parsing Excel > > spreadsheets in Python. Any well known/recommended libraries for this? > > > The only thing I found in a brief search was

Re: embedding python in wxpython

2008-12-30 Thread Joe Strout
Steve Holden wrote: I'd like the console to be a bidirectional representation of what's going on in the gui, plus a general purpose evaluation environment where you can manipulate application data via some api which is automatically exposed to the console when the application opens up. I'm look

[ANN] PyYAML-3.08: Now with Python 3 support

2008-12-30 Thread Kirill Simonov
Announcing PyYAML-3.08 A new release of PyYAML is now available: http://pyyaml.org/wiki/PyYAML This release features complete support for Python 3. For compatibility notes between Python 2 and Python 3 versions, please see http://pyya

Re: need help with list/variables

2008-12-30 Thread Jonathan Gardner
On Dec 30, 11:41 am, 5lvqbw...@sneakemail.com wrote: > > >>> conc = lambda x,y: x[:] + y # concatenate 2 lists without side effects > >>> mylist = ['something\n', 'another something\n', 'something again\n'] > >>> myvar = reduce(conc, mylist) > >>> print myvar > "conc"? "side effects"? Missing Lisp

Re: embedding python in wxpython

2008-12-30 Thread Mike Driscoll
On Dec 30, 3:41 pm, Steve Holden wrote: > 5lvqbw...@sneakemail.com wrote: > > Hi, I've looked around for a way to allow a python console from within > > a wxPython application, but have only found stuff on embedded/ > > extending python with C/C++ or wxWidgets in C++, but not wxPython. > > > Is th

Re: "return" in def

2008-12-30 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : (snip) Avoiding early exits is an over-reaction to the Bad Old Days of spaghetti code. Mostly, yes. It can also be a way to help avoiding "resource leaks" (memory or whatever) - just like try/finally blocks or the 'with' statement in Python. But used wisely, earl

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread Gabriel Genellina
En Tue, 30 Dec 2008 06:16:23 -0200, k3xji escribió: As GLOBAL_LOOP_COUNT is 1000, now this is making a bottleneck on the readers. I had assumed that as everythread is given only 100 bytecodes to execute, that it will be enough to have a 1 value for this number to let other rthread start

Re: get method

2008-12-30 Thread James Mills
On Tue, Dec 30, 2008 at 7:10 PM, Roel Schroeven wrote: > Hm, you just changed an O(n) algorithm to an O(n**2) algorithm. No big > deal for short strings, but try your solution on a string with length > 1 and see the difference. On my computer the O(n) version takes > 0.008 seconds, while your

Re: Python in C

2008-12-30 Thread Stefan Behnel
akineko wrote: > The more you work on Python, the harder you can go back to C or C++ > world. > > I use SWIG, instead. I think SWIG is a good way to mix two worlds. If you find it hard to go from Python back to C, you should have a look at Cython. http://cython.org/ Stefan -- http://mail.python

Re: multiprocessing vs thread performance

2008-12-30 Thread James Mills
On Wed, Dec 31, 2008 at 12:29 AM, Aaron Brady wrote: > James, Hi. I'm glad you asked; I never know how "out there" my > comments are (but surmise that feedback is always a good thing). What > I was thinking was, I didn't know Virtual Synchrony, and I've never > used Erlang, but I'm interested in

Re: python import sys.path

2008-12-30 Thread John Machin
On Dec 31, 5:05 am, "Kelly, Brian" wrote: > I have both 2.4 and 2.5 interpreters installed on a linux box. The > PythonPath is set to : > > PYTHONPATH=/usr/lib64/portage/pym:/prod/bacula/local/lib64/python2.4/site-pa > ckages:/prod/bacula/local/lib/python2.4/site-packages > > My main script is get

Re: need help with list/variables

2008-12-30 Thread John Machin
On Dec 31, 6:41 am, 5lvqbw...@sneakemail.com wrote: > On Dec 30, 11:31 am, wx1...@gmail.com wrote: > > > I have a list and would like to parse the list appending each list > > item to the end of a variable on a new line. > > > for instance > > > mylist = ['something\n', 'another something\n', 'some

Re: get method

2008-12-30 Thread MRAB
James Mills wrote: On Tue, Dec 30, 2008 at 7:10 PM, Roel Schroeven wrote: Hm, you just changed an O(n) algorithm to an O(n**2) algorithm. No big deal for short strings, but try your solution on a string with length 1 and see the difference. On my computer the O(n) version takes 0.008 second

Re: Understanding search queries, semantics, and "Meaning" ...aren't we all looking for meaning?

2008-12-30 Thread 5lvqbwl02
> > library, as I'm looking to learn to fish, so to speak, and to learn a > > bit about the biology of fish. > > I'm going to break rule #1 of your requirements but in an unexpected > way. Rather than studying PostgreSQL, MySQL, or Oracle, why don't you > crack open the topic of relational database

[ANN]: circuits-1.0b1 released!

2008-12-30 Thread James Mills
Hi all, I'm pleased to announce the release of circuits-1.0b1 Overview == circuits is an event-driven framework with a focus on Component Software Architectures where System Functionality is defined in Components. Components communicate with one another by propagating events throughout the s

Re: get method

2008-12-30 Thread James Mills
On Wed, Dec 31, 2008 at 9:15 AM, MRAB wrote: (snip) > A while back I posted a Python implementation of 'bag' (also called a > multiset). The code would then become something like: What complexity is this ? cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Triple quoted string in exec function ?

2008-12-30 Thread Gabriel Genellina
En Tue, 30 Dec 2008 18:16:39 -0200, Stef Mientki escribió: ibpe...@gmail.com wrote: the message Steven sent you is ok to explain how to work with triple quote Yes, but not to work around my problem. I guess I've to remove all triple quoted strings from my code. Why so? You only have to a

Re: Python 3.0 Curses Unicode

2008-12-30 Thread Damian Johnson
Just resolved the issue (turned out to be an issue with linked ncurses libraries). If others run into this discussion of the solution can be found at: http://bugs.python.org/issue4787 Cheers! -Damian On Mon, Dec 29, 2008 at 10:30 PM, Damian Johnson wrote: > It seems as if the curses module in P

  1   2   >