Re: Is Python a commercial proposition ?

2012-08-24 Thread Chris Withers
On 30/07/2012 03:31, Rodrick Brown wrote: Hence the reason why no one will seriously look at Python for none glue work or simple web apps. When it comes to designing complex applications that need to exploit large multicore systems Python just isn't an option. Its still not possible to be a pur

Re: Objects in Python

2012-08-24 Thread Antoon Pardon
On 23-08-12 01:58, Ben Finney wrote: > > You haven't discovered anything about types; what you have discovered is > that Python name bindings are not variables. > > In fact, Python doesn't have variables – not as C or Java programmers > would understand the term. What it has instead are references

Re: Objects in Python

2012-08-24 Thread Antoon Pardon
On 24-08-12 09:38, Antoon Pardon wrote: > On 23-08-12 01:58, Ben Finney wrote: > >> You haven't discovered anything about types; what you have discovered is >> that Python name bindings are not variables. >> >> In fact, Python doesn't have variables – not as C or Java programmers >> would unders

Re: Data cleaning workouts

2012-08-24 Thread Mark Lawrence
Elevated Python types don't get their hands dirty top posting, but I'm certain that they would when talking data or there wouldn't be so many debates on which data type to use :) On 24/08/2012 07:48, Fg Nu wrote: Thanks. I will try the SciPy list. It was a bit of a hail mary anyway. Pretty

Re: Does a wxPython program not run on 64bit Windows?

2012-08-24 Thread Mark Lawrence
On 24/08/2012 06:37, Levi Nie wrote: Does a wxPython program not run on 64bit Windows? I saw this “ wxPython is a cross-platform toolkit. This means that the same program will run on multiple platforms without modification. Currently supported platforms are 32-bit Microsoft Windows, most Unix

Re: Does a wxPython program not run on 64bit Windows?

2012-08-24 Thread Laszlo Nagy
On 2012-08-24 07:37, Levi Nie wrote: Does a wxPython program not run on 64bit Windows? Did you at least try to download wxPython? Because the download page shows the 64bit and the 32bit versions as well. :-) http://wxpython.org/download.php By the way, the 32bit version will gladly run on a

Re: Re: Objects in Python

2012-08-24 Thread Evan Driscoll
On 8/23/2012 22:17, alex23 wrote: > But Roy's point was that referring to 'a' as a 'variable' makes no > sense, as it's not an allocated piece of memory. Does the computer just remember what 'a' refers to by keeping notes about it in Narnia? Put it this way. If C removed the & operator -- and thu

Re: Objects in Python

2012-08-24 Thread Steven D'Aprano
On Fri, 24 Aug 2012 04:14:27 -0500, Evan Driscoll wrote: > On 8/23/2012 22:17, alex23 wrote: >> But Roy's point was that referring to 'a' as a 'variable' makes no >> sense, as it's not an allocated piece of memory. > > Does the computer just remember what 'a' refers to by keeping notes > about it

Identity function id() [was Re: Objects in Python]

2012-08-24 Thread Steven D'Aprano
On Thu, 23 Aug 2012 20:36:27 -0400, Roy Smith wrote: > The id has changed! Now, we all know that the id of an object is its > memory address (that's not guaranteed, but in the standard C > implementation of Python, that's what it is). It's not only "not guaranteed", it is *explicitly* noted as a

Installation of yappi (timing module)

2012-08-24 Thread Virgil Stokes
I have been doing some experiments with different modules for the timing of functions and code segments. One module I would like to test is yappi (thread aware timer) which is listed at PyPI. However, I have been unable to install it on Windows Vista and Windows 7 (Python 2.7 on both). I have tr

Re: Is Python a commercial proposition ?

2012-08-24 Thread lipska the kat
On 23/08/12 22:46, Chris Withers wrote: On 30/07/2012 03:31, Rodrick Brown wrote: Hence the reason why no one will seriously look at Python for none glue work or simple web apps. When it comes to designing complex applications that need to exploit large multicore systems Python just isn't an opt

squeeze install python-gi

2012-08-24 Thread contro opinion
我发现squeeze 不能安装python-gi,没有squeeze的版本 from gi.repository import Gtk def destroy_cb(widget): Gtk.main_quit() w = Gtk.Window() w.connect('destroy', destroy_cb) l = Gtk.Label() l.set_text("Hello World!") w.add(l) w.show_all() Gtk.main() 这样简单的代码,无法在squeeze里面运行? -- http://mail.python.org/mai

Re: Re: Objects in Python

2012-08-24 Thread wu wei
On Fri, Aug 24, 2012 at 7:14 PM, Evan Driscoll wrote: > On 8/23/2012 22:17, alex23 wrote: > > But Roy's point was that referring to 'a' as a 'variable' makes no > > sense, as it's not an allocated piece of memory. > > Does the computer just remember what 'a' refers to by keeping notes > about it

Re: protobuf + pypy

2012-08-24 Thread Pedro Larroy
_with pypy_ On Wed, Aug 22, 2012 at 12:16 AM, Mark Lawrence wrote: > On 21/08/2012 22:55, Pedro Larroy wrote: >> >> Hi >> >> Anyone knows if it's possible to use protobuffers with pypy? Seems >> there isn't much info on the web about this. >> >> Pedro. >> > > Did you mean this, in which case th

Re: Objects in Python

2012-08-24 Thread Alexander Blinne
On 23.08.2012 20:30, Dennis Lee Bieber wrote: > On Thu, 23 Aug 2012 15:33:33 +1000, Chris Angelico > declaimed the following in gmane.comp.python.general: >> x = 1; >> >> In C, this means: Assign the integer 1 to the variable x (possibly >> with implicit type casting, eg to floating point). >> >

Re: Objects in Python

2012-08-24 Thread Grant Edwards
On 2012-08-24, Steven D'Aprano wrote: > On Fri, 24 Aug 2012 04:14:27 -0500, Evan Driscoll wrote: > >> On 8/23/2012 22:17, alex23 wrote: >>> But Roy's point was that referring to 'a' as a 'variable' makes no >>> sense, as it's not an allocated piece of memory. >> >> Does the computer just remember

python-list@python.org

2012-08-24 Thread Prasad, Ramit
Ulrich Eckhardt wrote: > A good tool would reduce the effort and guide users, like e.g. giving > them a hint if they leave the whole mail they're replying to as copy. > Several corporate email solutions (like MS Outlook/Exchange) put very > little emphasis on communication efficiency but only on ey

python-list@python.org

2012-08-24 Thread Ramchandra Apte
As BFDL, I hereby command everybody to stop the discussion. lets put time on useful stuff i am using google groups (i think it knows what to do) -- http://mail.python.org/mailman/listinfo/python-list

Re: squeeze install python-gi

2012-08-24 Thread Ramchandra Apte
On Friday, 24 August 2012 17:17:15 UTC+5:30, contro opinion wrote: > 我发现squeeze 不能安装python-gi,没有squeeze的版本 > > > from gi.repository import Gtk > > def destroy_cb(widget): > Gtk.main_quit() > > w = Gtk.Window() > w.connect('destroy', destroy_cb) > > l = Gtk.Label() > > l.set_text("Hello W

Re: Built-in open() with buffering > 1

2012-08-24 Thread Ramchandra Apte
`f._CHUNK_SIZE = 5` is modifying Python's internal variables - don't do that google buffering to find out what it is buffering is how much Python will keep in memory f.read(1) will actually read `buffering` bytes of memory so that when you read later, the reading can be done from memory On Friday,

python-list@python.org

2012-08-24 Thread Mark Lawrence
On 24/08/2012 15:23, Ramchandra Apte wrote: As BFDL, I hereby command everybody to stop the discussion. lets put time on useful stuff Well I didn't vote for you :) i am using google groups (i think it knows what to do) -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinf

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread Ramchandra Apte
On Thursday, 23 August 2012 18:17:29 UTC+5:30, (unknown) wrote: > This is neither a complaint nor a question, just a comment. > > > > In the previous discussion related to the flexible > > string representation, Roy Smith added this comment: > > > > http://groups.google.com/group/comp.lang.

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ramchandra Apte
On Wednesday, 22 August 2012 22:13:04 UTC+5:30, Terry Reedy wrote: > On 8/22/2012 3:30 AM, Mark Lawrence wrote: > > > On 22/08/2012 06:46, Terry Reedy wrote: > > >> On 8/21/2012 11:43 PM, mingqiang hu wrote: > > >>> why filter is bad when use lambda ? > > >> > > >> Inefficient, not 'bad'. Bec

Re: psphere: how to make thread safe

2012-08-24 Thread Ramchandra Apte
On Wednesday, 22 August 2012 17:33:48 UTC+5:30, sajuptpm wrote: > Hi, > > > > psphere: Python interface for the VMware vSphere Web Services SDK > > > > I already developed an app using https://bitbucket.org/jkinred/psphere. But > getting lot of errors since psphere is not thread safe (I thi

Re: something about split()???

2012-08-24 Thread Laszlo Nagy
On 2012-08-15 07:33, Ramchandra Apte wrote: filter is bad when you use lambda with it there are (good) cases for filter On 14 August 2012 22:39, Jean-Michel Pichavant > wrote: Ramchandra Apte wrote: (Much) more Pythonic solution: >>> filter(N

python-list@python.org

2012-08-24 Thread rusi
On Aug 24, 7:23 pm, Ramchandra Apte wrote: > As BFDL, I hereby command everybody to stop the discussion. > lets put time on useful stuff > > i am using google groups (i think it knows what to do) Your posts are coming in doubles. And the quoted lines are coming double-spaced! Actually the 'new'

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Terry Reedy
On 8/24/2012 10:44 AM, Ramchandra Apte wrote: On Wednesday, 22 August 2012 22:13:04 UTC+5:30, Terry Reedy wrote: >>> timeit.timeit("list(i for i in ranger if False)", "ranger=range(0)") >> 0.91 >>> timeit.timeit("list(i for i in ranger if False)", "ranger=range(20)") 1.28 >>> timei

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread rusi
On Aug 24, 12:22 am, Ian Kelly wrote: > On Thu, Aug 23, 2012 at 12:33 PM,   wrote: > >> >>> sys.getsizeof('a' * 80 * 50) > > >> > 4025 > > >> sys.getsizeof('a' * 80 * 50 + '•') > > >> > 8040 > > >>     This example is still benefiting from shrinking the number of bytes > > >> in half over usi

Re: Unittest - testing for filenames and filesize

2012-08-24 Thread Tigerstyle
Thank you guys, Roy and Terry. I has been great help. I still need some help. Here is the updated code: Demostration of setUp and tearDown. The tests do not actually test anything - this is a demo. """ import unittest import tempfile import shutil import glob import os class FileTest(unittest.

Re: Looking for duplicate modules

2012-08-24 Thread rusi
On Aug 23, 8:30 pm, Roy Smith wrote: > We got burned yesterday by a scenario which has burned us before.  We had > multiple copies of a module in sys.path.  One (the one we wanted) was in our > deployed code tree, the other was in /usr/local/lib/python/ or some such.  It > was a particularly co

python-list@python.org

2012-08-24 Thread rusi
On Aug 24, 8:58 pm, rusi wrote: > On Aug 24, 7:23 pm, Ramchandra Apte wrote: > > > As BFDL, I hereby command everybody to stop the discussion. > > lets put time on useful stuff > > > i am using google groups (i think it knows what to do) > > Your posts are coming in doubles. > And the quoted line

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread Mark Lawrence
On 24/08/2012 17:06, rusi wrote: Actually what exactly are you (jmf) asking for? Its not clear to anybody as best as we can see... A knee in the temple and a dagger up the ? :) From another Monty Python sketch for those who don't know. -- Cheers. Mark Lawrence. -- http://mail.python.o

python-list@python.org

2012-08-24 Thread Chris Angelico
On Fri, Aug 24, 2012 at 11:53 PM, Prasad, Ramit wrote: > Ulrich Eckhardt wrote: >> BTW: You omitted the attribution line for the text you quoted, whom do >> you blame for that? That said, "Nonsense" is a strong enough word to >> start a flamewar... not nice. > Fair enough. I typically leave off at

Re: Looking for duplicate modules

2012-08-24 Thread Chris Angelico
On Fri, Aug 24, 2012 at 1:30 AM, Roy Smith wrote: > I'm working on a tool which scans all the directories in sys.path and finds > any modules which appear multiple times in the path. It'll also call out any > .pyc's it finds without matching py's. > This is why I love high level languages. The

Re: Is Python a commercial proposition ?

2012-08-24 Thread Roy Smith
On Sunday, July 29, 2012 12:01:00 PM UTC-4, lipska the kat wrote: > How is python used in the real world. songza.com is pretty close to 100% python. The only significant non-python code on the server side are mongodb, haproxy, and nginx. > What sized projects are people involved with We've got

Re: Unittest - testing for filenames and filesize

2012-08-24 Thread Robert Day
On Fri, 2012-08-24 at 09:20 -0700, Tigerstyle wrote: > def test_3(self): > f = open("test.dat", "wb") > filesize = b"0"*100 > f.write(filesize) > f.close() > self.assertEqual(os.stat, filesize) > The test_3 is to test if the created binary file har

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Walter Hurry
On Fri, 24 Aug 2012 14:29:00 -0400, Dennis Lee Bieber wrote: > It appears to be a change Google made in the last month or two... My > hypothesis is that they are replacing hard EOL found in inbound NNTP > with an HTML , and then on outgoing replacing the with a pair of > NNTP line endings. In con

Re: Objects in Python

2012-08-24 Thread Chris Angelico
On Fri, Aug 24, 2012 at 11:27 PM, Grant Edwards wrote: > Ah, but as we are always fond of saying in this group "that's an > implementation detail, and not part of the language definition". The > model where a compiler is "keeping notes about it in Narnia" is also > perfectly valid. However, RAM i

python-list@python.org

2012-08-24 Thread Ethan Furman
Chris Angelico wrote: PLEASE add attribution back in. It's not about he-said/she-said, it's about honesty and clarity in reporting. It's far easier to understand the conversation when we know who said each part [. . .] +1 -- http://mail.python.org/mailman/listinfo/python-list

Coroutines framework for Python 3

2012-08-24 Thread Thibaut
Hi, The question is in the title, is there any coroutine framework available for Python 3.2+ ? I checked gevent and eventlet but none of them seems to have a Py3k version. Thanks, -- http://mail.python.org/mailman/listinfo/python-list

calling loaded DLL function expecting POINT * argument

2012-08-24 Thread Tim Williams
Hello all, I'm trying to use the ctypes module to call functions in a DLL. I've figured out how to modify my path so the library is found, and I can call LoadLibrary on it, but one of the functions expects an array of POINTS. Here is the prototype from the .h file: TRACKER_API HRESULT Initial

Re: help with simple print statement!

2012-08-24 Thread Chris Kaynor
On Fri, Aug 24, 2012 at 12:43 PM, Willem Krayenhoff wrote: > Any idea why print isn't working here? > > I tried restarting my Command prompt. Also, print doesn't work inside a > class. > > [image: Inline image 2] > In Python 3, print was made into a function rather than a statement for various r

Re: help with simple print statement!

2012-08-24 Thread Rob Day
On Fri, 2012-08-24 at 12:43 -0700, Willem Krayenhoff wrote: > Any idea why print isn't working here? You're using Python 3.2, but trying Python 2.7 syntax - http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function should explain the problem adequately. (Incidentally - you can

Re: help with simple print statement!

2012-08-24 Thread Zero Piraeus
: On 24 August 2012 15:43, Willem Krayenhoff wrote: > Any idea why print isn't working here? http://docs.python.org/release/3.0.1/whatsnew/3.0.html#print-is-a-function Also, pasting images into emails to this list is unlikely to gain you many friends ... -[]z. -- http://mail.python.org/mailm

RE: help with simple print statement!

2012-08-24 Thread Prasad, Ramit
Willem Krayenhoff Any idea why print isn't working here?   I tried restarting my Command prompt.  Also, print doesn't work inside a class. -- Best Wishes,      Bruce      C: 604-441-5791      My Availability  Just as a note, this is a usenet group that can be accessed via email; a good po

proper reply format [was Re: help with simple print statement!]

2012-08-24 Thread Ethan Furman
Prasad, Ramit wrote: Willem Krayenhoff Any idea why print isn't working here? I tried restarting my Command prompt. Also, print doesn't work inside a class. Ramit, The standard for attribution is something along the lines of: Prasad, Ramit wrote: or Willem Kayenhoff wrote: Just havi

RE: help with simple print statement!

2012-08-24 Thread Bruce Krayenhoff
Thank-you all, it works now! Best Wishes, Bruce C: 604-441-5791 My Availability From: python-list-bounces+wbrucek=gmail@python.org [mailto:python-list-bo

Re: proper reply format

2012-08-24 Thread Christian Heimes
Am 24.08.2012 22:31, schrieb Ethan Furman: > Just having Willem's name at the top was confusing. Also, because you > didn't trim his signature, the rest of your reply looked like a > signature to Thunderbird (which uses a line of '--' to figure the start > of signatures). As you can see, the rest

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Terry Reedy
On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper newsreader? Probably because the

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Emile van Sebille
On 8/24/2012 3:03 PM Terry Reedy said... On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Mark Lawrence
On 24/08/2012 23:03, Terry Reedy wrote: On 8/24/2012 5:56 PM, Dennis Lee Bieber wrote: On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry declaimed the following in gmane.comp.python.general: Google Groups sucks. These are computer literate people here. Why don't they just use a proper n

concurrent.futures inconsistency?

2012-08-24 Thread Mark Summerfield
Hi, It seems that in concurrent.futures, ProcessPoolExecutor() can be used with no args and default to max_workers=multiprocessing.cpu_count(); but for ThreadPoolExecutor() the max_workers arg is required. Is this intentional? (I'm using Python 3.2.) -- http://mail.python.org/mailman/listinfo/pyt

Is there a way to configure IDLE to use spaces instead of tabs for indenting?

2012-08-24 Thread Alex
I'm new to Python and have been using IDLE 3.2.3 to experiment with code as I learn. Despite being configured to use a 4 space indentation width, sometimes IDLE's "smart" indentation insists upon using width-8 tabs. >From what I've been able to find on Google, this is due to a shortcoming in Tk. W

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ned Deily
In article , Emile van Sebille wrote: > On 8/24/2012 3:03 PM Terry Reedy said... > > Python lists are available on the free gmane mail-to-news server. > I'm getting high load related denials with the gmane connections a lot > recently so I'm open to alternatives. The high load denials should be

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Ned Deily
In article , Mark Lawrence wrote: > I don't think the core-mentorship list is available on gmane. Have I > missed it, has nobody asked for it to go on there or what? core-mentorship is a closed list so it would not be appropriate for it to be mirrored anywhere. http://mail.python.org/mailman

Re: Filter versus comprehension (was Re: something about split()???)

2012-08-24 Thread Walter Hurry
On Fri, 24 Aug 2012 17:56:47 -0400, Dennis Lee Bieber wrote: > On Fri, 24 Aug 2012 19:03:51 + (UTC), Walter Hurry > declaimed the following in > gmane.comp.python.general: > > >> Google Groups sucks. These are computer literate people here. Why don't >> they just use a proper newsreader? >

Unit test discovery with XML Runner?

2012-08-24 Thread lucretiel
Hey All, I've just started with the unittest module and I love it. I've been using test discovery- "python -m unittest discover" from the command line- so that I can distribute my tests amongst files instead of having tp manage them all. I'd like to publish the test results, though. Googling po

Re: Flexible string representation, unicode, typography, ...

2012-08-24 Thread Antoine Pitrou
Ramchandra Apte gmail.com> writes: > > The zen of python is simply a guideline What's more, the Zen guides the language's design, not its implementation. People who think CPython is a complicated implementation can take a look at PyPy :-) Regards Antoine. -- Software development and contr

Publish unittest results from test discovery

2012-08-24 Thread Lucretiel
So I've started using unittest, and I love it. I use testdiscovery (python -m unittest discover) so that I can distribute my tests and don't have to manage them all manually. I wanted to start publishing my test results to xml, though. I found xmlrunner by googling around, but it requires me to

Re: Publish unittest results from test discovery

2012-08-24 Thread Steven D'Aprano
On Fri, 24 Aug 2012 17:25:05 -0700, Lucretiel wrote: [...] > Is there a way to get unittest disover to work with xmlrunner Steady on there! It's only been about an hour and a half since you last asked this exact same question, almost word-for-word identical. The more specialised the question, t

python-list@python.org

2012-08-24 Thread Dave Angel
On 08/24/2012 12:39 PM, rusi wrote: > On Aug 24, 8:58 pm, rusi wrote: >> >> Your posts are coming in doubles. >> And the quoted lines are coming double-spaced! > Just saw other double-posts > So checked the mailing list archive which does not seem to have them. > > So please ignore my double-pos

Re: Variables vs names [was: Objects in Python]

2012-08-24 Thread Steven D'Aprano
On Thu, 23 Aug 2012 14:22:08 -0500, Evan Driscoll wrote: > On 08/23/2012 12:56 PM, Steven D'Aprano wrote: >> On Thu, 23 Aug 2012 12:17:03 -0500, Evan Driscoll wrote: >> >>> I definitely *wouldn't* say "Python >>> classes aren't really classes" -- even though (I assert) Python >>> classes are *far

Re: Objects in Python

2012-08-24 Thread Steven D'Aprano
On Fri, 24 Aug 2012 08:00:59 +1000, Chris Angelico wrote: > On Fri, Aug 24, 2012 at 3:56 AM, Steven D'Aprano > wrote: >> But name bindings are a kind of variable. Named memory locations are a >> *different* kind of variable. The behaviour of C variables and Python >> variables do not follow the L

fabric problem with ssh

2012-08-24 Thread Tim Arnold
I am getting started with fabric and trying to connect to any machine in my known hosts file. I want fabric to figure out that it doesn't need me to enter my password. My fabfile.py: from fabric.api import run, env env.disable_known_hosts=False def lsfiles(): run('ls -l ~/') My console r

Re: Variables vs names

2012-08-24 Thread Ben Finney
Steven D'Aprano writes: > On Thu, 23 Aug 2012 14:22:08 -0500, Evan Driscoll wrote: > > > In [the hypothetical language] Python--, any time you use a name, > > you have to prefix it with the word 'variable': > > variable x = 4 > > print(variable x) > > > > Does Python-- have variables? > > O

PyPyODBC 0.8 released (Pure Python ODBC module)

2012-08-24 Thread 江文
PyPyODBC - A Pure Python ctypes ODBC module Changes in version 0.8: Added the getinfo() method to the connection object Changes in version 0.7: Fixed the ntext/nchar/nvarchar string truncat problem Changes in version 0.6: Added Cursor.commit() and Cursor.rollback(). Added readonly keyword to c

Re: Objects in Python

2012-08-24 Thread Chris Angelico
On Sat, Aug 25, 2012 at 1:04 PM, Steven D'Aprano wrote: > You're confusing two different levels of explanation here. On the one > hand, you're talking about C semantics, where you are explicitly > responsible for managing unnamed data via indirection (pointers). > Typically, the *pointers* get giv