Re: String concatenation - which is the fastest way ?

2011-08-10 Thread przemolicc
On Wed, Aug 10, 2011 at 06:20:10PM +0200, Stefan Behnel wrote: > przemol...@poczta.fm, 10.08.2011 15:31: >> On Wed, Aug 10, 2011 at 01:32:06PM +0100, Chris Angelico wrote: >>> On Wed, Aug 10, 2011 at 12:17 PM, wrote: I'd like to write a python (2.6/2.7) script which connects to database, >>>

Re: allow line break at operators

2011-08-10 Thread Ben Finney
Seebs writes: > On 2011-08-10, Ben Finney wrote: > > Seebs writes: > >> On 2011-08-10, Chris Angelico wrote: > >> > And if we require {} then truly free indentation should be OK too! > >> > But it wouldn't be Python any more. > > >> Would it really not be Python at all? > > > See the Python in

Re: Puzzled about the output of my demo of a proof of The Euler Series

2011-08-10 Thread casevh
On Aug 10, 4:57 pm, "Richard D. Moores" wrote: > I saw an interesting proof of the limit of The Euler Series on > math.stackexchange.com at > . > Scroll down to Hans Lundmark's post. > > I thought I'd try to see this "pinchi

Re: multiprocessing timing issue

2011-08-10 Thread Tim Roberts
Tim Arnold wrote: > >The task: >I have a bunch of chapters that I want to gather data on individually >and then update a report database with the results. >I'm using multiprocessing to do the data-gathering simultaneously. > >Each chapter report gets put on a Queue in their separate processes. >

Re: allow line break at operators

2011-08-10 Thread Michael Trausch
VB (classic; .NET versions no longer have it) had an "option explicit" where you had to define each variable explicitly, otherwise by default you created variables simply by assigning to them. They did it that way to enable backwards compatibility for those who wanted the old style. Most people wo

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Ben Finney wrote: > Seebs writes: >> On 2011-08-10, Chris Angelico wrote: >> > And if we require {} then truly free indentation should be OK too! >> > But it wouldn't be Python any more. >> Would it really not be Python at all? > See the Python interpreter's response to ???from

Re: allow line break at operators

2011-08-10 Thread Chris Rebert
> On Aug 10, 2011 10:57 PM, "Yingjie Lan" wrote: >> :And if we require {} then truly free indentation should be OK too! But >> >> :it wouldn't be Python any more. >> >> Of course, but not the case with ';'. Currently ';' is optional in Python, >> But '{' is used for dicts. Clearly, ';' and '{' are

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-11, Steven D'Aprano wrote: > Seebs wrote: >> On 2011-08-10, Chris Angelico wrote: >>> And if we require {} then truly free indentation should be OK too! But >>> it wouldn't be Python any more. >> Would it really not be Python at all? > Of course it wouldn't be. Every function, class,

Re: allow line break at operators

2011-08-10 Thread Michael Trausch
Perhaps it could be made an optional thing to enable; for example, some languages by default do dynamic typing, but with an option contained as the first statement of the file can enforce static typing. On Aug 10, 2011 10:57 PM, "Yingjie Lan" wrote: > :And if we require {} then truly free indentat

Re: Bizarre behavior of the 'find' method of strings

2011-08-10 Thread Jim
Thanks for all you guys. Now I got it. To Steven, I was in a little rush when I put this post. But you are right. It's not the find method's problem. -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
On Thu, 11 Aug 2011 12:52 pm Yingjie Lan wrote: > :And if we require {} then truly free indentation should be OK too! But > > :it wouldn't be Python any more. > > Of course, but not the case with ';'. Currently ';' is optional in Python, > But '{' is used for dicts. Clearly, ';' and '{' are diff

Re: allow line break at operators

2011-08-10 Thread Chris Rebert
On Wed, Aug 10, 2011 at 7:52 PM, Yingjie Lan wrote: > :And if we require {} then truly free indentation should be OK too! But > > :it wouldn't be Python any more. > > Of course, but not the case with ';'. Currently ';' is optional in Python, I think of it more as that Python deigns to permit semi

Re: problem installing psyco on windows (Unable to find vcvarsall.bat)

2011-08-10 Thread Dan Stromberg
FWIW, a few months ago I was working on a database application on Windows, and I benchmarked the psyco-enhanced version consistently running slower than the non-psyco version. The same code on Linux was faster with psyco though. If you need performance, and you aren't constrained by module availa

Re: Bizarre behavior of the 'find' method of strings

2011-08-10 Thread Chris Rebert
On Wed, Aug 10, 2011 at 7:56 PM, Steven D'Aprano wrote: > On Thu, 11 Aug 2011 11:24 am Jim wrote: > >> Greetings, folks, >> >> I am using python 2.7.2. Here is something I got: > a = 'popular' > i = a.find('o') > j = a.find('a') > a[i:j] >> 'opul' >> >> Well, I expected a[i:j] to b

Re: Searching for Lottery drawing list of ticket match...

2011-08-10 Thread Miki Tebeka
Python built in types are enough for this problem IMO. You can use sets of tuples to specify ticket and drawings and then just do set intersection. Say the drawing is set([(5, 'wb'), (1, 'wb'), (45, 'wb'), (23, 'wb'), (27, 'wb')]) (keeping black ball out). The you can create a score function: S

Re: multiprocessing timing issue

2011-08-10 Thread Philip Semanchuk
On Aug 9, 2011, at 1:07 PM, Tim Arnold wrote: > Hi, I'm having problems with an empty Queue using multiprocessing. > > The task: > I have a bunch of chapters that I want to gather data on individually and > then update a report database with the results. > I'm using multiprocessing to do the da

Re: problem installing psyco on windows (Unable to find vcvarsall.bat)

2011-08-10 Thread Miki Tebeka
You can download the sources tarball and when building specify the compiler. See http://docs.python.org/install/index.html#gnu-c-cygwin-mingw -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
On Wed, Aug 10, 2011 at 1:58 PM, Yingjie Lan wrote: > Is it possible for python to allow free splitting of single-line statements > without the backslashes, if we impose that expressions can only be split > when it is not yet a finished expression? :The trouble is that in a lot of cases, the nex

Re: Bizarre behavior of the 'find' method of strings

2011-08-10 Thread Steven D'Aprano
On Thu, 11 Aug 2011 11:24 am Jim wrote: > Greetings, folks, > > I am using python 2.7.2. Here is something I got: a = 'popular' i = a.find('o') j = a.find('a') a[i:j] > 'opul' > > Well, I expected a[i:j] to be 'opula', and can't think of any reason why > this is not happening

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
:And if we require {} then truly free indentation should be OK too! But :it wouldn't be Python any more. Of course, but not the case with ';'. Currently ';' is optional in Python, But '{' is used for dicts. Clearly, ';' and '{' are different in magnitude. So the decision is: shall we change ';'

[ANNC] pynguin-0.11 python turtle graphics application

2011-08-10 Thread Lee Harr
Pynguin is a python-based turtle graphics application.     It combines an editor, interactive interpreter, and     graphics display area. It is meant to be an easy environment for introducing     some programming concepts to beginning programmers. http://pynguin.googlecode.com/ This release c

PyCon Australia 2011: Registration Closing Soon!

2011-08-10 Thread Ryan Kelly
Hi Everyone, Registrations for PyCon Australia 2011 are closing soon! The conference is just over a week away, so we need final numbers in the next few days. If you're planning to attend, please register now! PyCon Australia is Australia's only conference dedicated exclusively to the Python p

Re: Bizarre behavior of the 'find' method of strings

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 2:48 AM, MRAB wrote: > Python uses half-open ranges, which means that the start position is > inclusive and the end position is exclusive. > Or if you prefer: Python identifies positions between characters, rather than characters. And I agree that it's better than the alte

Re: Bizarre behavior of the 'find' method of strings

2011-08-10 Thread MRAB
On 11/08/2011 02:24, Jim wrote: Greetings, folks, I am using python 2.7.2. Here is something I got: a = 'popular' i = a.find('o') j = a.find('a') a[i:j] 'opul' Well, I expected a[i:j] to be 'opula', and can't think of any reason why this is not happening. So, can anybody help me out about thi

Re: Cookie Problem

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:39 AM, Jack Hatterly wrote: >     cookie['lastvisit'] = str(time.time()) >     cookie['lastvisit']['expires'] = 30 * 24 * 60 * 60 >     cookie['lastvisit']['path'] = '/var/www/html/my_site/' >     cookie['lastvisit']['comment'] = 'holds the last user\'s visit date' >    

Bizarre behavior of the 'find' method of strings

2011-08-10 Thread Jim
Greetings, folks, I am using python 2.7.2. Here is something I got: >>> a = 'popular' >>> i = a.find('o') >>> j = a.find('a') >>> a[i:j] 'opul' Well, I expected a[i:j] to be 'opula', and can't think of any reason why this is not happening. So, can anybody help me out about this? Thank you very m

Re: Docstrings and class Attributes

2011-08-10 Thread Ben Finney
Steven D'Aprano writes: > So just because a feature is an accident of history, doesn't mean that > a use can't be found for it. Which I explicitly noted in my message. I suppose it's inevitable for the nuances of one's utterances to be forgotten as the discussion progresses, but darn if it ain't

Re: Python & Sullivan

2011-08-10 Thread Ben Finney
Tim Chase writes: > On 08/10/2011 05:42 PM, Chris Angelico wrote: > > PS. I mistakenly sent this to a Gilbert& Sullivan group > > first. Oddly enough, opera-goers are not used to discussing > > the relative merits of braces vs indentation in code. > > It's only fair turnabout: > > http://coding.

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 1:32 AM, Steven D'Aprano wrote: >> I've seen bits of code in preprocessing-based "Python with {}" type >> things, and they still look like Python to me, only they favor explicit >> over implicit a little more strongly. > > "Looks like" Python does not equal "is Python". Cob

code object differences between 2.7 and 3.3a

2011-08-10 Thread Eric Snow
Specifically, I am wondering why there is a difference for co_names. Here is a function that exercises the different code object pieces[1]: def g(y=5): a = 7 def f(x, w=y, z=4, *args, **kwargs): b = a c = global_x return f f1 = g() Here are the results for 2.7: >>> for nam

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
Seebs wrote: > On 2011-08-10, Chris Angelico wrote: >> And if we require {} then truly free indentation should be OK too! But >> it wouldn't be Python any more. > > Would it really not be Python at all? Of course it wouldn't be. Every function, class, if, while, for, try...except block etc. in

Puzzled about the output of my demo of a proof of The Euler Series

2011-08-10 Thread Richard D. Moores
I saw an interesting proof of the limit of The Euler Series on math.stackexchange.com at . Scroll down to Hans Lundmark's post. I thought I'd try to see this "pinching down" on the limit of pi**2/6. Se

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:32 AM, Steven D'Aprano wrote: > Chris stated that putting the unary + at the end of the line > prevents "that", that being applying the unary + operator to the value on > the right. But that is not the case -- unary prefix operators in Python can > be separated from thei

Re: Python & Sullivan

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:26 AM, Tim Chase wrote: > On 08/10/2011 05:42 PM, Chris Angelico wrote: >> >> PS. I mistakenly sent this to a Gilbert&  Sullivan group >> first. Oddly enough, opera-goers are not used to discussing >> the relative merits of braces vs indentation in code. > > It's only fa

Cookie Problem

2011-08-10 Thread Jack Hatterly
Hi; I'm trying to get this cookie code to work but it doesn't set the properties I want set (expires, path, comment, etc.). When I delete the cookie and run the script it duly creates a cookie. However, when I reload the page none of the morsels have values associated with them. I also do no

Re: Docstrings and class Attributes

2011-08-10 Thread Steven D'Aprano
John Pinner wrote: > On Aug 9, 1:36 am, Ben Finney wrote: >> Ethan Furman writes: >> > So if property docstrings are so hard to get to, what's the point in >> > having them? >> >> Why would you expect there be a special point to them? >> >> Men, like all primates of any sex, have nipples. >> >>

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
Ian Kelly wrote: > On Wed, Aug 10, 2011 at 8:37 AM, Steven D'Aprano > wrote: >>> Without the parentheses, this is legal but (probably) useless; it >>> applies the unary + operator to the return value of those functions. >>> Putting the + at the end of the previous line at least prevents that, >>>

Re: Python & Sullivan

2011-08-10 Thread Tim Chase
On 08/10/2011 05:42 PM, Chris Angelico wrote: PS. I mistakenly sent this to a Gilbert& Sullivan group first. Oddly enough, opera-goers are not used to discussing the relative merits of braces vs indentation in code. It's only fair turnabout: http://coding.derkeiler.com/Archive/Python/comp.lan

problem installing psyco on windows (Unable to find vcvarsall.bat)

2011-08-10 Thread Gelonida N
Hi, I'd like to install psyco on my windows host I'm using python 2.6.4 (32 bit version) I installed easy_intall and pip easy_install psyco and pip install psyco fail both with the message error: Setup script exited with error: Unable to find vcvarsall.bat I read, that this means I shoul di

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 10:51 PM, Ben Finney wrote: > Seebs writes: >> I've seen bits of code in preprocessing-based "Python with {}" type >> things, and they still look like Python to me, only they favor >> explicit over implicit a little more strongly. > > They introduce unnecessary ambiguity:

Re: allow line break at operators

2011-08-10 Thread Ben Finney
Seebs writes: > On 2011-08-10, Chris Angelico wrote: > > And if we require {} then truly free indentation should be OK too! > > But it wouldn't be Python any more. > > Would it really not be Python at all? See the Python interpreter's response to ‘from __future__ import braces’. > I've seen bi

Re: Directions on accessing shared folder in windows network

2011-08-10 Thread Christian Heimes
Am 10.08.2011 21:52, schrieb Ameet Nanda: > Hi, > > Can anyone point me to a way to access windows shared folders from the > network using a python script. I tried accessing using open, which is > mentioned to work perfectly on the web, but it gives me following errors The open() function wraps t

Re: Directions on accessing shared folder in windows network

2011-08-10 Thread MRAB
On 10/08/2011 20:52, Ameet Nanda wrote: Hi, Can anyone point me to a way to access windows shared folders from the network using a python script. I tried accessing using open, which is mentioned to work perfectly on the web, but it gives me following errors >>>open(NW_PATH) it gives me a perm

Directions on accessing shared folder in windows network

2011-08-10 Thread Ameet Nanda
Hi, Can anyone point me to a way to access windows shared folders from the network using a python script. I tried accessing using open, which is mentioned to work perfectly on the web, but it gives me following errors >>>open(NW_PATH) it gives me a permission denied error as follows: >>> open("

Searching for Lottery drawing list of ticket match...

2011-08-10 Thread MrPink
I need a little nudge into the right direction with this problem. As an exercise for me to learn about Python, I am trying to determine the best way to search a list of "lottery drawings" for a match with a lottery ticket. Possible numbers for a drawing are: 5 whiteballs (wb): 1-55 1 blackball (bb

Re: SocketServer expceion after upgrading to 2.7

2011-08-10 Thread Irmen de Jong
On 10-08-11 15:42, Laszlo Nagy wrote: Exception happened during processing of request from ('80.99.165.122', 56069) Traceback (most recent call last): File "/usr/local/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "/usr/loc

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Chris Angelico wrote: > And if we require {} then truly free indentation should be OK too! But > it wouldn't be Python any more. Would it really not be Python at all? I've seen bits of code in preprocessing-based "Python with {}" type things, and they still look like Python to me,

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Eric Snow
On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman wrote: > On Aug 7, 4:06 am, Eric Snow wrote: >> Thought I knew how to provide a dynamic __name__ on instances of a >> class.  My first try was to use a non-data descriptor: >> >> # module base.py >> >> class _NameProxy(object): >>     def __init__(self, o

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 10, 5:27 pm, Eric Snow wrote: > On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman wrote: > > On Aug 5, 12:29 pm, Ryan wrote: > >> In the context of descriptors, the __set__ method is not called for > >> class attribute access. __set__ is only > >> called to set the attribute on an instance instan

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 10, 4:25 pm, Ian Kelly wrote: > On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman wrote: > > __name__ can be a descriptor, so you just need to write a descriptor > > that can be fetched from classes as well as instances. > > > Here's an example with a property (instance only): > > class Foo(o

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Eric Snow
On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman wrote: > On Aug 5, 12:29 pm, Ryan wrote: >> In the context of descriptors, the __set__ method is not called for >> class attribute access. __set__ is only >> called to set the attribute on an instance instance of the owner class >> to a new value, value.

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Stefan Behnel
przemol...@poczta.fm, 10.08.2011 15:31: On Wed, Aug 10, 2011 at 01:32:06PM +0100, Chris Angelico wrote: On Wed, Aug 10, 2011 at 12:17 PM, wrote: I'd like to write a python (2.6/2.7) script which connects to database, fetches hundreds of thousands of rows, concat them (basically: create XML) an

Re: Docstrings and class Attributes

2011-08-10 Thread John Pinner
On Aug 9, 1:36 am, Ben Finney wrote: > Ethan Furman writes: > > So if property docstrings are so hard to get to, what's the point in > > having them? > > Why would you expect there be a special point to them? > > Men, like all primates of any sex, have nipples. > > Properties, like any function i

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 2:19 PM, Yingjie Lan wrote: > If ';' are employed (required), truely free line-splitting should be OK, > the operators may appear at the beginnings of the lines as you wish. > And if we require {} then truly free indentation should be OK too! But it wouldn't be Python any

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
>> In terms of easier to read, I find code easier to read when the >> operators are at the beginnings of the lines (PEP 8 notwithstanding): >> >>    x = (someobject.somemethod(object3, thing) >>         + longfunctionname(object2) >>         + otherfunction(value1, value2, value3)) >> > > Without

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Duncan Booth
Fuzzyman wrote: >> The descriptor protocol only works when a value is being accessed or set >> on an instance and there is no instance attribute of that name so the >> value is fetched from the underlying class. >> > > That's not true. Properties, for example, can be got or set even when > they

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Ian Kelly
On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman wrote: > __name__ can be a descriptor, so you just need to write a descriptor > that can be fetched from classes as well as instances. > > Here's an example with a property (instance only): > class Foo(object): > ...   @property > ...   def __name__(s

Re: allow line break at operators

2011-08-10 Thread Ian Kelly
On Wed, Aug 10, 2011 at 8:37 AM, Steven D'Aprano wrote: >> Without the parentheses, this is legal but (probably) useless; it >> applies the unary + operator to the return value of those functions. >> Putting the + at the end of the previous line at least prevents that, >> since most unary operator

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 3:37 PM, Steven D'Aprano wrote: >> Without the parentheses, this is legal but (probably) useless; it >> applies the unary + operator to the return value of those functions. >> Putting the + at the end of the previous line at least prevents that, >> since most unary operator

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 7, 4:06 am, Eric Snow wrote: > Thought I knew how to provide a dynamic __name__ on instances of a > class.  My first try was to use a non-data descriptor: > > # module base.py > > class _NameProxy(object): >     def __init__(self, oldname): >         self.oldname = oldname >     def __get__

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 1:58 PM, Yingjie Lan wrote: > Is it possible for python to allow free splitting of single-line statements > without the backslashes, if we impose that expressions can only be split > when it is not yet a finished expression? The trouble is that in a lot of cases, the next

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
Dan Sommers wrote: > In terms of easier to read, I find code easier to read when the operators > are at the beginnings of the lines (PEP 8 notwithstanding): > > x = (someobject.somemethod(object3, thing) > + longfunctionname(object2) > + otherfunction(value1, value2, value3)

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 1:16 pm, Duncan Booth wrote: > Ryan wrote: > > In the context of descriptors, the __set__ method is not called for > > class attribute access. __set__ is only > > called to set the attribute on an instance instance of the owner class > > to a new value, value. WHY? Is there some other m

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
Chris Angelico wrote: > On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers > wrote: >> In terms of easier to read, I find code easier to read when the operators >> are at the beginnings of the lines (PEP 8 notwithstanding): >> >> x = (someobject.somemethod(object3, thing) >> + longfunctionname(object2

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Steven D'Aprano
przemol...@poczta.fm wrote: > Hello, > > I'd like to write a python (2.6/2.7) script which connects to database, > fetches hundreds of thousands of rows, concat them (basically: create XML) > and then put the result into another table. Do I have any choice > regarding string concatenation in Pyth

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 3:38 PM, Chris Angelico wrote: > Which SQL library are you suing? And this is why I should proof-read BEFORE, not AFTER, sending. Which SQL library are you *using*? ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 2:31 PM, wrote: > - fetch all rows from the database (up to 1 million): what is recommended > data type ? > - spawn X python processes each one: >    - concat its own subset > - merge the result from all the subprocesses > What you're writing is, fundamentally, glue betw

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 12:29 pm, Ryan wrote: > In the context of descriptors, the __set__ method is not called for > class attribute access. __set__ is only > called to set the attribute on an instance instance of the owner class > to a new value, value. WHY? It's an unfortunate asymmetry in the descriptor pr

Re: Segmentation Fault on exit

2011-08-10 Thread ron
On Aug 6, 6:35 am, Vipul Raheja wrote: > Hi, > > I have wrapped a library from C++ to Python using SWIG. But when I > import it in Python, I am able to work fine with it, but it gives a > segmentation fault while exiting. Following is the log: > > vipul@vipul-laptop:~/ossim-svn/src/pyossim/swig$ p

problem with GTK language

2011-08-10 Thread Peter Irbizon
Hello, I have strange problem with gtk language in pygtk. When I run .py file it shows all gtk labels in my default windows language (slovak). But when I compile it with py2exe and run exe file all labels are in english. Why this happens? How can I define on program startup which language to use? I

Python-URL! - weekly Python news and links (Aug 10)

2011-08-10 Thread Cameron Laird
QOTW: "If an elegant solution doesn't occur to me right away, then I first compose the most obvious solution I can think of. Finally, I refactor it until elegance is either achieved or imagined." - Neil Cerutti, 2011-07-28 What is the real purpose of __all__? http://old.nabble.com/__all

Python-URL! - weekly Python news and links (Aug 10)

2011-08-10 Thread Cameron Laird
QOTW: "If an elegant solution doesn't occur to me right away, then I first compose the most obvious solution I can think of. Finally, I refactor it until elegance is either achieved or imagined." - Neil Cerutti, 2011-07-28 What is the real purpose of __all__? http://old.nabble.com/__all

SocketServer expceion after upgrading to 2.7

2011-08-10 Thread Laszlo Nagy
Exception happened during processing of request from ('80.99.165.122', 56069) Traceback (most recent call last): File "/usr/local/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock self.process_request(request, client_address) File "/usr/local/lib/python2.7/SocketServe

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread przemolicc
On Wed, Aug 10, 2011 at 01:32:06PM +0100, Chris Angelico wrote: > On Wed, Aug 10, 2011 at 12:17 PM, wrote: > > Hello, > > > > I'd like to write a python (2.6/2.7) script which connects to database, > > fetches > > hundreds of thousands of rows, concat them (basically: create XML) > > and then pu

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
> On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers > wrote: >> In terms of easier to read, I find code easier to read when the >> operators are at the beginnings of the lines (PEP 8 notwithstanding): >> >>    x = (someobject.somemethod(object3, thing) >>         + longfunctionname(object2) >>      

I need help/information on Freeze.py

2011-08-10 Thread mike turner
Hello all, How do you use freeze.py to freeze an application? I have an application built with pylons and I want to make it into a portable executable, is that possible? Thanks for the help. - mikey -- http://mail.python.org/mailman/listinfo/python-list

gtk STOCK_SAVE text in another language

2011-08-10 Thread Peter Irbizon
hello, I have slovak win but I would like to have english captions on pygtk STOCK_SAVE buttons. How can I set this? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 1:25 PM, Duncan Booth wrote: > Chris Angelico wrote: > >> On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers >> wrote: >>> In terms of easier to read, I find code easier to read when the >>> operators are at the beginnings of the lines (PEP 8 notwithstanding): >>> >>>    x = (

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 12:17 PM, wrote: > Hello, > > I'd like to write a python (2.6/2.7) script which connects to database, > fetches > hundreds of thousands of rows, concat them (basically: create XML) > and then put the result into another table. Do I have any choice > regarding string conca

Re: allow line break at operators

2011-08-10 Thread Duncan Booth
Chris Angelico wrote: > On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers > wrote: >> In terms of easier to read, I find code easier to read when the >> operators are at the beginnings of the lines (PEP 8 notwithstanding): >> >>    x = (someobject.somemethod(object3, thing) >>         + longfunctio

String concatenation - which is the fastest way ?

2011-08-10 Thread przemolicc
Hello, I'd like to write a python (2.6/2.7) script which connects to database, fetches hundreds of thousands of rows, concat them (basically: create XML) and then put the result into another table. Do I have any choice regarding string concatenation in Python from the performance point of view ? S

How to solve this problem

2011-08-10 Thread jana1972
I have a client that is a part of a local network.This client has a local address( not public).Is there a way how I can connect to this client from outside world? What software must I install so that I can connect and control that client from outside? Thanks B -- http://mail.python.org/mailm

Re: How to solve this problem

2011-08-10 Thread Chris Angelico
On Tue, Aug 9, 2011 at 12:10 PM, Johny wrote: > I have a client that  is a part of a local network.This client has a > local address( not public).Is there a way how I can connect to this > client from outside world? > What software must I install so that I can connect and control that > client fro

Re: allow line break at operators

2011-08-10 Thread TheSaint
Yingjie Lan wrote: > #the new way > x = 1+2+3+4+ #line continues as it is clearly unfinished > > 1+2+3+4 > Genrally I prefer this way. > Of course, the dot operator is also included, which may facilitate method > chaining: > > x = svg.append( 'circle' ). Dot-ended is to tiny thing that might c

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers wrote: > In terms of easier to read, I find code easier to read when the operators > are at the beginnings of the lines (PEP 8 notwithstanding): > >    x = (someobject.somemethod(object3, thing) >         + longfunctionname(object2) >         + otherfu

Re: subprocess.Popen and thread module

2011-08-10 Thread Thomas Rachel
Am 10.08.2011 08:38 schrieb Danny Wong (dannwong): Hi All, I'm trying to execute some external commands from multiple database. I'm using threads and subprocess.Popen ( from docs, all the popen* functions are deprecated and I was told to use subprocess.Popen) to execute the external commands

Re: allow line break at operators

2011-08-10 Thread Dan Sommers
On Wed, 10 Aug 2011 18:32:05 +1000, Steven D'Aprano wrote: > Python is a programming language, not an ice cream shop. +1 QOTW How about a cheese shop? In terms of easier to read, I find code easier to read when the operators are at the beginnings of the lines (PEP 8 notwithstanding): x =

Re: Restricted attribute writing

2011-08-10 Thread Thomas Jollans
On 07/08/11 17:35, John O'Hagan wrote: > I'm looking for good ways to ensure that attributes are only writable such > that they retain the characteristics the class requires. > > My particular case is a class attribute which is initialised as a list of > lists of two integers, the first of whic

http://123maza.com/65/share858/

2011-08-10 Thread ranganayaki rangs
http://123maza.com/65/share858/ -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 9:32 AM, Steven D'Aprano wrote: >>> Of course, the dot operator is also included, which may facilitate method >>> chaining: >>> >>> x = svg.append( 'circle' ). >>> r(2).cx(1).xy(1). >>> foreground('black').bkground('white') > > If you are chaining six dots like that, you ar

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
On Wed, 10 Aug 2011 04:05 pm Yingjie Lan wrote: > :# the currently allowed way > :x = (1+2+3+4+ > :1+2+3+4) > :# note the parentheses > : > :I think this is sufficient. > > That works, but not in the most natural way--the way people are customed > to...why require a pair of parenthis when we can

Re: subprocess.Popen and thread module

2011-08-10 Thread Chris Rebert
> From: Chris Rebert >> On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) >> wrote: >>> Hi All, >>>   I'm trying to execute some external commands from multiple database. >>> I'm using threads and subprocess.Popen ( from docs, all the popen* >>> functions are deprecated and I was told to use

Run clang static analyzer on Python 3.30a

2011-08-10 Thread Seung Soo , Ha
Hello, I just ran the clang static analyzer on Python. I'm very new to this, so please bear with me as a describe the exact steps I took. 1. hg clone of python 2. scan-build ./configure --with-pydebug 3. scan-build make -s -j4 4. scan-view /tmp/scan-build-2011-08-10-1/ It shows 6 bugs and the

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
I did read that portion of the doc, then I change it to communicate and it still hangs. So I reverted back to "wait" while launching one thread to see if I could isolate the problem, but it still hangs regardless of using "wait" or "communicate". -Original Message- From: ch...@rebertia.

Re: subprocess.Popen and thread module

2011-08-10 Thread Chris Rebert
> On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) > wrote: >> Hi All, >>   I'm trying to execute some external commands from multiple database. >> I'm using threads and subprocess.Popen ( from docs, all the popen* >> functions are deprecated and I was told to use subprocess.Popen) to >> exe