pypiserver 0.2.0 - minimal pypi server

2011-08-10 Thread Ralf Schmitt
Hi, I've just uploaded pypiserver 0.2.0 to the python package index. pypiserver is a minimal PyPI compatible server. It can be used to serve a set of packages and eggs to easy_install or pip. pypiserver is easy to install (i.e. just easy_install pypiserver). It doesn't have any external

GOZERBOT 0.9.3 BETA1 released

2011-08-10 Thread Bart Thate
Hi world and every living thing on it ! I just want to give a headsup to the fact that i released the first beta of GOZERBOT 0.9.3. This release brings in a lot of bug fixes, so please try it out ;] Download is at http://gozerbot.googlecode.com, please if you find problems with the bot file a

ANN: SfePy 2011.3

2011-08-10 Thread Robert Cimrman
I am pleased to announce release 2011.3 of SfePy. Description --- SfePy (simple finite elements in Python) is a software for solving systems of coupled partial differential equations by the finite element method. The code is based on NumPy and SciPy packages. It is distributed under the

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
On Tue, Aug 9, 2011 at 9:42 PM, Yingjie Lan lany...@yahoo.com wrote: Hi all, When writing a long expresion, one usually would like to break it into multiple lines. Currently, you may use a '\' to do so, but it looks a little awkward (more like machine-oriented thing). Therefore I start

subprocess.Popen and thread module

2011-08-10 Thread 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 in parallel, but the commands seems to hang. My

Re: subprocess.Popen and thread module

2011-08-10 Thread Chris Rebert
On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) dannw...@cisco.com 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

RE: subprocess.Popen and thread module

2011-08-10 Thread Danny Wong (dannwong)
Hi Chris, Here is the code, try: cmd_output = subprocess.Popen(['scm', 'load', '--force', '-r', nickname, '-d', directory, project], stdout=subprocess.PIPE, stderr=subprocess.PIPE) status = cmd_output.wait() print In load status is: %s % status + \n except:

Re: subprocess.Popen and thread module

2011-08-10 Thread Chris Rebert
On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) dannw...@cisco.com 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)

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.com

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

Re: subprocess.Popen and thread module

2011-08-10 Thread Chris Rebert
From: Chris Rebert c...@rebertia.com On Tue, Aug 9, 2011 at 11:38 PM, Danny Wong (dannwong) dannw...@cisco.com 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

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 do

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 9:32 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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

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: 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 Chris Angelico
On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers d...@tombstonezero.net 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: 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 cause

Re: How to solve this problem

2011-08-10 Thread Chris Angelico
On Tue, Aug 9, 2011 at 12:10 PM, Johny pyt...@hope.cz 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

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

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 ?

Re: allow line break at operators

2011-08-10 Thread Duncan Booth
Chris Angelico ros...@gmail.com wrote: On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers d...@tombstonezero.net 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,

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 12:17 PM, 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

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 1:25 PM, Duncan Booth duncan.booth@invalid.invalid wrote: Chris Angelico ros...@gmail.com wrote: On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers d...@tombstonezero.net wrote: In terms of easier to read, I find code easier to read when the operators are at the beginnings

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

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

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
On Wed, Aug 10, 2011 at 10:56 AM, Dan Sommers d...@tombstonezero.net 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)         +

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

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

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__?

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__?

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?

Re: Segmentation Fault on exit

2011-08-10 Thread ron
On Aug 6, 6:35 am, Vipul Raheja vipul.ii...@gmail.com 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:

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 12:29 pm, Ryan heni...@yahoo.com 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

Re: String concatenation - which is the fastest way ?

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 2:31 PM, przemol...@poczta.fm 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,

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 ros...@gmail.com 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 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 Python

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 d...@tombstonezero.net 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) +

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 5, 1:16 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: Ryan heni...@yahoo.com 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

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: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 1:58 PM, Yingjie Lan lany...@yahoo.com 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

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 7, 4:06 am, Eric Snow ericsnowcurren...@gmail.com 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 =

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 3:37 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: allow line break at operators

2011-08-10 Thread Ian Kelly
On Wed, Aug 10, 2011 at 8:37 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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 fuzzy...@gmail.com 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

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Duncan Booth
Fuzzyman fuzzy...@gmail.com 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

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 the

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Wed, Aug 10, 2011 at 2:19 PM, Yingjie Lan lany...@yahoo.com 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

Re: Docstrings and class Attributes

2011-08-10 Thread John Pinner
On Aug 9, 1:36 am, Ben Finney ben+pyt...@benfinney.id.au wrote: Ethan Furman et...@stoneleaf.us 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: 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,przemol...@poczta.fm 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

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 fuzzy...@gmail.com wrote: On Aug 5, 12:29 pm, Ryan heni...@yahoo.com 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

Re: how to dynamically generate __name__ for an object?

2011-08-10 Thread Fuzzyman
On Aug 10, 4:25 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Aug 10, 2011 at 8:48 AM, Fuzzyman fuzzy...@gmail.com 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

Re: __set__ method is not called for class attribute access

2011-08-10 Thread Fuzzyman
On Aug 10, 5:27 pm, Eric Snow ericsnowcurren...@gmail.com wrote: On Wed, Aug 10, 2011 at 8:33 AM, Fuzzyman fuzzy...@gmail.com wrote: On Aug 5, 12:29 pm, Ryan heni...@yahoo.com wrote: In the context of descriptors, the __set__ method is not called for class attribute access. __set__ is only

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 fuzzy...@gmail.com wrote: On Aug 7, 4:06 am, Eric Snow ericsnowcurren...@gmail.com 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

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Chris Angelico ros...@gmail.com 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

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

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

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:

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

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 the

Re: allow line break at operators

2011-08-10 Thread Ben Finney
Seebs usenet-nos...@seebs.net writes: On 2011-08-10, Chris Angelico ros...@gmail.com 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 Angelico
On Wed, Aug 10, 2011 at 10:51 PM, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net 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.

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

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:

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 steve+comp.lang.pyt...@pearwood.info 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

Re: Docstrings and class Attributes

2011-08-10 Thread Steven D'Aprano
John Pinner wrote: On Aug 9, 1:36 am, Ben Finney ben+pyt...@benfinney.id.au wrote: Ethan Furman et...@stoneleaf.us 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

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

Re: Python Sullivan

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:26 AM, Tim Chase python.l...@tim.thechases.com 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

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:32 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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 http://math.stackexchange.com/questions/8337/different-methods-to-compute-sum-n-1-infty-frac1n2. Scroll down to Hans Lundmark's post. I thought I'd try to see this pinching down on the limit of pi**2/6. See

Re: allow line break at operators

2011-08-10 Thread Steven D'Aprano
Seebs wrote: On 2011-08-10, Chris Angelico ros...@gmail.com 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

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 name

Re: allow line break at operators

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 1:32 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

Re: Python Sullivan

2011-08-10 Thread Ben Finney
Tim Chase python.l...@tim.thechases.com 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

Re: Docstrings and class Attributes

2011-08-10 Thread Ben Finney
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info 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

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 much. Jim

Re: Cookie Problem

2011-08-10 Thread Chris Angelico
On Thu, Aug 11, 2011 at 12:39 AM, Jack Hatterly jackhatte...@hotmail.com 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

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

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 pyt...@mrabarnett.plus.com 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

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

[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

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 ';'

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. So, can anybody help

Re: allow line break at operators

2011-08-10 Thread Yingjie Lan
On Wed, Aug 10, 2011 at 1:58 PM, Yingjie Lan lany...@yahoo.com 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

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

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:

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 steve+comp.lang.pyt...@pearwood.info 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]

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

Re: allow line break at operators

2011-08-10 Thread Chris Rebert
On Wed, Aug 10, 2011 at 7:52 PM, Yingjie Lan lany...@yahoo.com 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

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 different

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 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 lany...@yahoo.com wrote: :And if we require {} then

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Seebs wrote: On 2011-08-10, Chris Angelico ros...@gmail.com 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

Re: allow line break at operators

2011-08-10 Thread Chris Rebert
On Aug 10, 2011 10:57 PM, Yingjie Lan lany...@yahoo.com 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 '{'

Re: allow line break at operators

2011-08-10 Thread Seebs
On 2011-08-10, Ben Finney ben+pyt...@benfinney.id.au wrote: Seebs usenet-nos...@seebs.net writes: On 2011-08-10, Chris Angelico ros...@gmail.com 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

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

Re: multiprocessing timing issue

2011-08-10 Thread Tim Roberts
Tim Arnold tim.arn...@sas.com 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

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 rdmoo...@gmail.com wrote: I saw an interesting proof of the limit of The Euler Series on math.stackexchange.com at http://math.stackexchange.com/questions/8337/different-methods-to-com Scroll down to Hans Lundmark's post. I thought I'd try to see

  1   2   >