Dabo 0.9.2 released

2009-06-04 Thread Ed Leafe
At long last, we are finally releasing Dabo 0.9.2. This fixes the errors that were found in 0.9.1; adds a brand-new Web Update implementation that should make keeping current much easier, as well as a whole bunch of improvements under the hood. You can grab the latest version at

ANN: Resolver One 1.5 released (corrects previous message)

2009-06-04 Thread Giles Thomas
We are proud to announce the release of Resolver One, version 1.5. Resolver One is a Windows-based spreadsheet that integrates Python deeply into its recalculation loop, making the models you build more reliable and more maintainable. For version 1.5, we've added a console; this new command-line

ANN: Veusz 1.4

2009-06-04 Thread Jeremy Sanders
Veusz 1.4 - Velvet Ember Under Sky Zenith - http://home.gna.org/veusz/ Veusz is Copyright (C) 2003-2009 Jeremy Sanders jer...@jeremysanders.net Licenced under the GPL (version 2 or greater). Veusz is a Qt4 based scientific plotting package. It is written in

web2py 1.63 is OUT

2009-06-04 Thread Massimo Di Pierro
web2py 1.63 is OUT Check out the new features in this slides: http://www.scribd.com/doc/16085263/web2py-slides-version-163 Massimo P.S. with love and respect to all other python programmers out there! -- http://mail.python.org/mailman/listinfo/python-announce-list Support the Python

Treat C FILE* as C++ streams

2009-06-04 Thread Michele De Stefano
Hello to everyone. I'm an Italian engineer and I'm approaching to Python, particularly to Python extension through C++ (because I'm an experienced C++ programmer). I've seen that Python files are basically managed through the C FILE pointer. I've recently released on Google Code a very small

Re: import sqlite3

2009-06-04 Thread Andrew McNamara
On 04/06/2009, at 3:15 PM, willgun wrote: When i run the following in IDLE: IDLE 2.6.1 import sqlite3 con =sqlite3.connect (r'g:\db1') everything goes well,but when i save these to a .py file and run it: Traceback (most recent call last): File C:\Users\hp\Desktop\SQLite3\sqlite3.py,

Re: import sqlite3

2009-06-04 Thread willgun
Gabriel Genellina 写道: En Thu, 04 Jun 2009 02:15:39 -0300, willgun will...@live.cn escribió: Traceback (most recent call last): File C:\Users\hp\Desktop\SQLite3\sqlite3.py, line 2, in module import sqlite3 File C:\Users\hp\Desktop\SQLite3\sqlite3.py, line 3, in module

Re: import sqlite3

2009-06-04 Thread willgun
Andrew McNamara 写道: On 04/06/2009, at 3:15 PM, willgun wrote: When i run the following in IDLE: IDLE 2.6.1 import sqlite3 con =sqlite3.connect (r'g:\db1') everything goes well,but when i save these to a .py file and run it: Traceback (most recent call last): File

Re: how to get rid of pyc files ?

2009-06-04 Thread Gabriel Genellina
[please keep the discussion on the list] may be python need a parameter to regenerate .pyo/pyc explicit ,not depending on magic number and modification time. but i just wander if you simply just clear all .pyc than generate in one system manually, can than program run without error in another

Re: Generating all combinations

2009-06-04 Thread Raymond Hettinger
Nice one! It only does partitions of a sequence. I haven't yet looked at a way to do partitions of a set. Any ideas? Raymond, as perhaps *the* principle contributor to itertools, do you feel that the combinatorics-related tools should be in their own module? Or is that dividing the module

Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Hendrik van Rooyen
When the days get colder and the nights longer, then evil things are hatched. A can is like a pickle, in that it is a string, but anything can be canned. Unlike a pickle, a can cannot leave the process, though, unless the object it points to lives in shared memory. Here is the output of a test

Re: OT: Can;'t find a Mozilla user group

2009-06-04 Thread Anthra Norell
Terry Reedy wrote: News123 wrote: Anthra Norell wrote: I can't run Firefox and Thunderbird without getting these upgrade ordering windows. I don't touch them, because I have reason to suspect that they are some (Russian) virus that hijacks my traffic. Occasionally one of these window pops

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Nick Craig-Wood
Esmail ebo...@hotmail.com wrote: Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks

Re: what is the biggest number that i can send to Wave_write.writeframes(data)

2009-06-04 Thread '2+
thanx for the example! somehow on juanty gui comes up but no sound .. anyway i shortened the script this way and could aplay it import wave AMPLITUDE = 2 ** 15 w = wave.open( out.wav, w ) w.setnchannels( 2 ) w.setsampwidth( 2 ) #BYTES w.setframerate( 22000 ) from array import array import math

Re: Get the hard disk hardware serial number

2009-06-04 Thread Nick Craig-Wood
MRAB pyt...@mrabarnett.plus.com wrote: Jorge wrote: I need to know how to get the hardware serial number of a hard disk in python. For Windows, see http://www.daniweb.com/forums/thread187326.html For linux I'd run this and parse the results. # smartctl -i /dev/sda smartctl version

Re: Project source code layout?

2009-06-04 Thread Lawrence D'Oliveiro
In message mailman.1089.1244091958.8015.python-l...@python.org, Allen Fowler wrote: I was hoping to keep the dev layout as close to deployment possible. Completely different purposes. For example, the actual production database and config files form no part of your development project, do

Access from a class attribute

2009-06-04 Thread Kless
Why can not to access from a class attribute to a function of that class? - class Foo(object): attr = __class__.__name__ attr = self.__class__.__name__ - -- http://mail.python.org/mailman/listinfo/python-list

Re: Access from a class attribute

2009-06-04 Thread Bruno Desthuilliers
Kless a écrit : Why can not to access from a class attribute to a function of that class? - class Foo(object): attr = __class__.__name__ attr = self.__class__.__name__ - class is an executable statement that instanciate a new class object and bind it to

Re: nntplib.NNTPTemporaryError: 441 Article has no body -- just headers

2009-06-04 Thread Jon Bendtsen
Jon Bendtsen wrote: Dennis Lee Bieber wrote: On Wed, 27 May 2009 14:25:58 +0200, Jon Bendtsen no...@example.com declaimed the following in gmane.comp.python.general: 'From: r...@laerdal.dk\nsubject: testing\nNewsgroups: test\nBody: \n\n\nfoobar\n\n\n.\n\n\n' I believe NNTP, like SMTP,

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Nigel Rantor
Hendrik van Rooyen wrote: If you have any interest, contact me and I will send you the source. Maybe you could tell people what the point is... n -- http://mail.python.org/mailman/listinfo/python-list

Re: import sqlite3

2009-06-04 Thread willgun
Andrew McNamara 写道: On 04/06/2009, at 4:14 PM, willgun wrote: What did you call the .py file? sqlite3.py? If so, you've just imported your own module again. 8-) After the import, try print sqlite3.__file__, which will tell you where the module came from. Thank you all the same. I'm a

Re: import sqlite3

2009-06-04 Thread willgun
By the way ,what does 'best regards' means at the end of a mail? -- http://mail.python.org/mailman/listinfo/python-list

Re: nntplib.NNTPTemporaryError: 441 Article has no body -- just headers

2009-06-04 Thread Jon Bendtsen
Jon Bendtsen wrote: Jon Bendtsen wrote: Dennis Lee Bieber wrote: On Wed, 27 May 2009 14:25:58 +0200, Jon Bendtsen no...@example.com declaimed the following in gmane.comp.python.general: 'From: r...@laerdal.dk\nsubject: testing\nNewsgroups: test\nBody: \n\n\nfoobar\n\n\n.\n\n\n' I

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Hendrik van Rooyen
Nigel Rantor wi...@wiggly.org wrote: Hendrik van Rooyen wrote: If you have any interest, contact me and I will send you the source. Maybe you could tell people what the point is... Well its a long story, but you did ask... I am working on an i/o system, running in an ebox - it is

Re: import sqlite3

2009-06-04 Thread Andrew McNamara
On 04/06/2009, at 9:45 PM, willgun wrote: By the way ,what does 'best regards' means at the end of a mail? The correspondent is wishing you well. You'll also see things like kind regards, best wishes and so on. Regard essentially means respect. --

Re: import sqlite3

2009-06-04 Thread pdpi
On Jun 4, 12:45 pm, willgun will...@live.cn wrote: By the way ,what does 'best regards' means at the end of a mail? regard means roughly care. Its use as best regards closing a letter (or, in this case, email), means that you care for the person you're saying goodbye to. It's just a polite way

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Nigel Rantor
Hendrik van Rooyen wrote: Nigel Rantor wi...@wiggly.org wrote: Hendrik van Rooyen wrote: If you have any interest, contact me and I will send you the source. Maybe you could tell people what the point is... Well its a long story, but you did ask... [snip] Maybe I should have said why

Re: Get the hard disk hardware serial number

2009-06-04 Thread Dietmar Schwertberger
MRAB schrieb: Jorge wrote: I need to know how to get the hardware serial number of a hard disk in python. For Windows, see http://www.daniweb.com/forums/thread187326.html This recipe uses the function GetVolumeInformation(), which does not return the hardware serial number. From the

Re: hash and __eq__

2009-06-04 Thread Albert van der Horst
In article 0233137f$0$8244$c3e8...@news.astraweb.com, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 31 May 2009 12:08:33 +0100, Arnaud Delobelle wrote: Anyway, it's good to know that quicksort is O(n^2) in the worst case - and that this worst case can crop up very easily

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Scott David Daniels
Esmail wrote: Scott David Daniels wrote: Esmail wrote: ... Tk seems a bit more complex .. but I really don't know much about it and its interface with Python to make any sort of judgments as to which option would be better. This should look pretty easy: Thanks Scott for taking the time to

Re: Exploding (**myvariable) a dict with unicode keys

2009-06-04 Thread Aahz
In article mailman.1038.1243986288.8015.python-l...@python.org, Samuel Wan s...@samuelwan.com wrote: I started using python last week and ran into exceptions thrown when unicode dictionary keys are exploded into function arguments. In my case, decoded json dictionaries did not work as function

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Hendrik van Rooyen
Nigel Rantor wi...@wiggly.org wrote: Hendrik van Rooyen wrote: Nigel Rantor wi...@wiggly.org wrote: Hendrik van Rooyen wrote: If you have any interest, contact me and I will send you the source. Maybe you could tell people what the point is... Well its a long story, but you

Re: Project source code layout?

2009-06-04 Thread Allen Fowler
I was hoping to keep the dev layout as close to deployment possible. Completely different purposes. For example, the actual production database and config files form no part of your development project, do they? And conversely, utility scripts that might be used, for example, to set

PEP 315: Enhanced While Loop

2009-06-04 Thread Daniel Cotton
During some random surfing I became interested in the below piece of code: while condition1: code1 and while condition2: code2 and while condition3: code3 else: other code It strikes me that the 'and while' syntax has some power that you

Re: Project source code layout?

2009-06-04 Thread Jean-Paul Calderone
On Thu, 04 Jun 2009 21:33:13 +1200, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message mailman.1089.1244091958.8015.python-l...@python.org, Allen Fowler wrote: I was hoping to keep the dev layout as close to deployment possible. Completely different purposes. For

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Jean-Paul Calderone
On Thu, 4 Jun 2009 16:49:42 +0200, Hendrik van Rooyen m...@microcorp.co.za wrote: [snip] It is not something that would find common use - in fact, I have never, until I started struggling with my current problem, ever even considered the possibility of converting a pointer to a string and back

Feedparser problem

2009-06-04 Thread Jonathan Nelson
I'm trying to add a feedreader element to my django project. I'm using Mark Pilgrim's great feedparser library. I've used it before without any problems. I'm getting a TypeError I can't figure out. I've tried searching google, bing, google groups to no avail. Here's the dpaste of what I'm

multi-core software

2009-06-04 Thread Xah Lee
Of interest: • Why Must Software Be Rewritten For Multi-Core Processors? http://xahlee.org/UnixResource_dir/writ/multi-core_software.html plain text version follows. -- Why Must Software Be Rewritten For Multi-Core Processors? Xah Lee,

Re: Generating all combinations

2009-06-04 Thread Mensanator
On Jun 4, 1:27 am, Raymond Hettinger pyt...@rcn.com wrote: Nice one! It only does partitions of a sequence.  I haven't yet looked at a way to do partitions of a set.  Any ideas? Raymond, as perhaps *the* principle contributor to itertools, do you feel that the combinatorics-related

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread skip
Hendrik A can is like a pickle, in that it is a string, but anything Hendrik can be canned. Unlike a pickle, a can cannot leave the Hendrik process, though, unless the object it points to lives in shared Hendrik memory. Got some use cases? Thx, -- Skip Montanaro -

Re: accessing the XML attribute value noNamespaceSchemaLocation thru Python 2.5

2009-06-04 Thread Stefan Behnel
tooshiny wrote: I am currently successfully using lxml and ElementTree to validate and to access the XML contained data. I can however not find any functional call to access the schema location ie the attribute value noNamespaceSchemaLocation. A simple function call would be so much nicer

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Terry Reedy
Hendrik van Rooyen wrote: I can see that my explanation passes you by completely. I said, in my original post, that a can could not leave a process. A can is exactly the same as a C pointer, only its value has been converted to a string, so that you can pass it in band as part of a string.

where in python

2009-06-04 Thread Chris
I am a newby in Python and I'm first looking for equivalent to things I already manage: IDL. For example, I want to plot a sub-set of points, selected from a bigger set by applying some filter. In my example, I want to select only the values 0. I succeed to write 5 different ways to do this,

python way to automate IE8's File Download dialog

2009-06-04 Thread monogeo
Hello, I am able to use PAMIE 2.0 to automate IE7's File Download dialog, but the same approach/code fails on IE8. You can see the details and code at http://tech.groups.yahoo.com/group/Pamie_UsersGroup/message/675 Please help if you are able to automate IE8's File Download dialog (with three

Re: Get the hard disk hardware serial number

2009-06-04 Thread Terry Reedy
Dietmar Schwertberger wrote: The WMI method is e.g. described here: http://www.velocityreviews.com/forums/t359670-wmi-help.html import wmi Not in the stdlib, but available here: http://pypi.python.org/pypi/WMI/1.3 and requires in turn pywin32: http://pypi.python.org/pypi/pywin32/210 c =

Re: Winter Madness - Passing Python objects as Strings

2009-06-04 Thread Nigel Rantor
Hendrik van Rooyen wrote: It is not something that would find common use - in fact, I have never, until I started struggling with my current problem, ever even considered the possibility of converting a pointer to a string and back to a pointer again, and I would be surprised if anybody else

Re: Get the hard disk hardware serial number

2009-06-04 Thread Paul Boddie
On 4 Jun, 11:29, Nick Craig-Wood n...@craig-wood.com wrote: For linux I'd run this and parse the results. # smartctl -i /dev/sda Also useful is hdparm, particularly with the drive identification and detailed information options shown respectively below: # hdparm -i /dev/sda # hdparm -I

Re: import _sqlite3 no module named error

2009-06-04 Thread Ned Deily
In article 77e831100906040708l1a8bf638n19bbff05607b3...@mail.gmail.com, Vincent Davis vinc...@vincentdavis.net wrote: I volunteered to help Marijo Mihelčić who was looking for someone with a mac the help him build a mac binary using py2app for his simpletasktimer

Re: import _sqlite3 no module named error

2009-06-04 Thread Vincent Davis
when I try to run his app I get the no module named _sqlite3 , I am not sure what this is caused by as it looks to me like sqlite3 is trying to import it. Any idea how to fix this? Other than the obvious of getting _sqlite3 somehow, or maby it is that simple  

Re: multi-core software

2009-06-04 Thread Kaz Kylheku
[Followup-To: header set to comp.lang.lisp.] On 2009-06-04, Roedy Green see_webs...@mindprod.com.invalid wrote: On Thu, 4 Jun 2009 09:46:44 -0700 (PDT), Xah Lee xah...@gmail.com wrote, quoted or indirectly quoted someone who said : • Why Must Software Be Rewritten For Multi-Core Processors?

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Thomas Heller
[Please keep the discussion on the list] Joseph Garvin schrieb: On Thu, Jun 4, 2009 at 3:43 AM, Thomas Heller thel...@python.net wrote: There have been some attempts to use ctypes to access C++ objects. We (Roman Yakovenko and myself) made some progress. We were able to handle C++ name

Re: import _sqlite3 no module named error

2009-06-04 Thread Ned Deily
In article 77e831100906041151g70868dbre1546cdb01082...@mail.gmail.com, Vincent Davis vinc...@vincentdavis.net wrote: Yes I am using macports I think sqlite is installed? here is what I get when I run sudo port install py25-sqlite3 vincent-daviss-macbook-pro-2:~ vmd$ sudo port install

Is socket.shutdown(1) useless

2009-06-04 Thread Mohamed Garrana
Hello This is is in answer for Is socket.shutdown(1) useless Shutdown(1) , forces the socket no to send any more data This is usefull in Buffer flushing Strange error detection Safe guarding Let me explain more , when you send a data , it's not guaranteed to be sent to your peer , it's only

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Philip Semanchuk
On Jun 4, 2009, at 3:35 PM, Thomas Heller wrote: [Please keep the discussion on the list] Joseph Garvin schrieb: On Thu, Jun 4, 2009 at 3:43 AM, Thomas Heller thel...@python.net wrote: There have been some attempts to use ctypes to access C++ objects. We (Roman Yakovenko and myself) made

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Thomas Heller
Philip Semanchuk schrieb: Hi Thomas, We're weighing options for accessing C++ objects via Python. I know of SIWG and Boost; are there others that you think deserve consideration? I haven't used any of them myself. A common suggestion is SIP, less known are pybindgen and Robin. But there

Re: import sqlite3

2009-06-04 Thread Gabriel Genellina
En Thu, 04 Jun 2009 03:14:18 -0300, willgun will...@live.cn escribió: I'm a student from China.It's painful for us to read python documentation entirely due to poor english.So I often make these mistakes. Try chinese python group at Google - I see some promising results at least... --

Re: Illegal seek with os.popen

2009-06-04 Thread pruebauno
On Jun 3, 3:36 pm, a...@pythoncraft.com (Aahz) wrote: In article 7c93031a-235e-4e13-bd37-7c9dbc6e8...@r16g2000vbn.googlegroups.com,  prueba...@latinmail.com wrote: Should I open a bug report for this? Python 2.5.1 (r251:54863, Sep 19 2007, 14:58:06) [C] on aix5 Type help, copyright,

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Brian
What is the goal of this conversation that goes above and beyond what Boost.Python + pygccxml achieve? Boost has published a variety of libraries that will be included into the next c++ standard. It's hard to imagine a better designed python/c++ interface library than Boost.Python. Further,

Re: What text editor is everyone using for Python

2009-06-04 Thread Nick Craig-Wood
Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Tue, 02 Jun 2009 10:54:48 +1200, Lawrence D'Oliveiro wrote: In message kkkmp7@spenarnc.xs4all.nl, Albert van der Horst wrote: An indication of how one can see one is in emacs is also appreciated. How about, hit

Re: Illegal seek with os.popen

2009-06-04 Thread Terry Reedy
prueba...@latinmail.com wrote: Python 3.0.1 (r301:69556, Jun 4 2009, 16:07:22) [C] on aix5 Type help, copyright, credits or license for more information. import os os.popen('cat','w') os._wrap_close object at 0x1103e5748 So it seems to be something in 3.1 that causes it to fail. BTW it is

Re: multi-core software

2009-06-04 Thread MRAB
Kaz Kylheku wrote: [Followup-To: header set to comp.lang.lisp.] On 2009-06-04, Roedy Green see_webs...@mindprod.com.invalid wrote: On Thu, 4 Jun 2009 09:46:44 -0700 (PDT), Xah Lee xah...@gmail.com wrote, quoted or indirectly quoted someone who said : • Why Must Software Be Rewritten For

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Philip Semanchuk
On Jun 4, 2009, at 4:23 PM, Brian wrote: What is the goal of this conversation that goes above and beyond what Boost.Python + pygccxml achieve? Boost has published a variety of libraries that will be included into the next c++ standard. It's hard to imagine a better designed python/c++

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Brian
Well you'll just have to try Boost.Python. There is a pygccxml gui gets you started in about 15 minutes. You'll be able to see how well it groks your code and what that generated code is. Boost is the best. People complain about it because they don't understand C++ templates and they don't

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Brian
Just to expound a bit on pygccxml, which really makes boost worth it. pygccxml enables you to do all of your binding work from within Python. It calls gccxml, which is an xml backend to gcc that outputs the parse tree in an xml format. Pygccxml provides a very high level interface between the gcc

Re: Illegal seek with os.popen

2009-06-04 Thread Aahz
[posted e-mailed] In article 5edde6ee-4446-4f53-91ee-ad3aea4b5...@q37g2000vbi.googlegroups.com, prueba...@latinmail.com wrote: Python 3.0.1 (r301:69556, Jun 4 2009, 16:07:22) [C] on aix5 Type help, copyright, credits or license for more information. import os os.popen('cat','w')

MultiReplace (performance and unordered dicts)

2009-06-04 Thread Joseph Reagle
I have programs that do lots of string-to-string replacements, so I'm trying to create a speedy implementation (tons of .replace statements has become unwieldy). My MultiReplace object does as well as the function regexp, which both do better than the for loop function, any other suggestions?

Odd closure issue for generators

2009-06-04 Thread Brian Quinlan
This is from Python built from the py3k branch: c = (lambda : i for i in range(11, 16)) for q in c: ... print(q()) ... 11 12 13 14 15 # This is expected c = (lambda : i for i in range(11, 16)) d = list(c) for q in d: ... print(q()) ... 15 15 15 15 15 # I was very surprised Looking

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Joseph Garvin
On Thu, Jun 4, 2009 at 3:23 PM, Brian brian.min...@colorado.edu wrote: What is the goal of this conversation that goes above and beyond what Boost.Python + pygccxml achieve? I can't speak for others but the reason I was asking is because it's nice to be able to define bindings from within

Re: What text editor is everyone using for Python

2009-06-04 Thread Lawrence D'Oliveiro
In message slrnh2g9ei.2ea.n...@irishsea.home.craig-wood.com, Nick Craig- Wood wrote: You quit emacs with Ctrl-X Ctrl-C. That's save-buffers-kill-emacs. If you don't want to save buffers, the exit sequence is alt-tilde, f, e. -- http://mail.python.org/mailman/listinfo/python-list

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Joseph Garvin
On Thu, Jun 4, 2009 at 2:35 PM, Thomas Heller thel...@ctypes.org wrote: [Please keep the discussion on the list] All in all, as I said, IMO it is too complicated to figure out the binary layout of the C++ objects (without using a C++ compiler), also there are quite some Python packages for

Re: What text editor is everyone using for Python

2009-06-04 Thread Lawrence D'Oliveiro
In message kkpx6l@spenarnc.xs4all.nl, Albert van der Horst wrote: Memories of Atari 260/520/1040 that had a keyboard with a key actually marked ... HELP. And the OLPC machines have a key marked reveal source. -- http://mail.python.org/mailman/listinfo/python-list

Re: Project source code layout?

2009-06-04 Thread Lawrence D'Oliveiro
In message mailman.1112.1244128369.8015.python-l...@python.org, Allen Fowler wrote: 1) Do you use virtualpython? No idea what that is. 2) How do you load the modules in your lib directory? At the beginning of my scripts, I have a sequence like test_mode = False # True for testing,

Re: where in python

2009-06-04 Thread Robert Kern
On 2009-06-04 12:53, Chris wrote: I am a newby in Python and I'm first looking for equivalent to things I already manage: IDL. For example, I want to plot a sub-set of points, selected from a bigger set by applying some filter. In my example, I want to select only the values 0. I succeed to

Re: Odd closure issue for generators

2009-06-04 Thread Gabriel Genellina
En Thu, 04 Jun 2009 18:40:07 -0300, Brian Quinlan br...@sweetapp.com escribió: This is from Python built from the py3k branch: It's not new; same thing happens with 2.x A closure captures (part of) the enclosing namespace, so names are resolved in that environment even after the

Re: Using C++ and ctypes together: a vast conspiracy? ;)

2009-06-04 Thread Scott David Daniels
Joseph Garvin wrote: On Thu, Jun 4, 2009 at 2:35 PM, Thomas Heller thel...@ctypes.org wrote: [Please keep the discussion on the list] All in all, as I said, IMO it is too complicated to figure out the binary layout of the C++ objects (without using a C++ compiler), also there are quite some

Re: Odd closure issue for generators

2009-06-04 Thread Carl Banks
On Jun 4, 2:40 pm, Brian Quinlan br...@sweetapp.com wrote: This is from Python built from the py3k branch:   c = (lambda : i for i in range(11, 16))   for q in c: ...     print(q()) ... 11 12 13 14 15   # This is expected   c = (lambda : i for i in range(11, 16))   d = list(c)   for

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Peter Pearson
On Thu, 04 Jun 2009 03:29:42 -0500, Nick Craig-Wood wrote: [snip] Here is a demo with pygame... [snip] And just for completeness, here is a demo with PyGUI, written in similar style. (I'm a PyGUI newbie, so constructive criticism would be appreciated.) from GUI import Window, View,

Re: easiest way to plot x,y graphically during run-time?

2009-06-04 Thread Esmail
Nick Craig-Wood wrote: Here is a demo with pygame... Thanks Nick, I'll be studying this too :-) Esmail -- http://mail.python.org/mailman/listinfo/python-list

Printing list/tuple elements on separate lines

2009-06-04 Thread Johnny Chang
I have a large list of strings that I am unpacking and splitting, and I want each one to be on a new line. Someone showed me how to do it and I got it working, except it is not printing each on its own separate line as his did, making it incredibly hard to read. He did it without adding a new

Yet another unicode WTF

2009-06-04 Thread Ron Garret
Python 2.6.2 on OS X 10.5.7: [...@mickey:~]$ echo $LANG en_US.UTF-8 [...@mickey:~]$ cat frob.py #!/usr/bin/env python print u'\u03BB' [...@mickey:~]$ ./frob.py ª [...@mickey:~]$ ./frob.py foo Traceback (most recent call last): File ./frob.py, line 2, in module print u'\u03BB'

__file__ access extremely slow

2009-06-04 Thread Zac Burns
The section of code below, which simply gets the __file__ attribute of the imported modules, takes more than 1/3 of the total startup time. Given that many modules are complicated and even have dynamic population this figure seems very high to me. it would seem very high if one just considered the

Re: What text editor is everyone using for Python

2009-06-04 Thread Ben Finney
Emile van Sebille em...@fenx.com writes: On 6/4/2009 3:19 PM Lawrence D'Oliveiro said... In message slrnh2g9ei.2ea.n...@irishsea.home.craig-wood.com, Nick Craig- Wood wrote: You quit emacs with Ctrl-X Ctrl-C. That's save-buffers-kill-emacs. If you don't want to save buffers, the

ctype question

2009-06-04 Thread Amit Gupta
Hi, I have been using ctype.cdll to load a library, but I am unable to figure out how to load multiple libraries that depends on each other. E.g. I have two libraries A.so and B.so. A.so has some undefined references, and those symbols are defined in B.so. When I try to load

Re: __file__ access extremely slow

2009-06-04 Thread Zac Burns
Sorry, there is a typo. The code should read as below to repro the problem: for module in sys.modules.itervalues(): try: path = module.__file__ except (AttributeError, ImportError): return

How do I continue after the error?

2009-06-04 Thread chad
Let's say I have a list of 5 files. Now lets say that one of the files reads nude333.txt instead of nude3.txt. When this happens, the program generates an error and quits. What I want it to do is just skip over the bad file and continue on with the next one. Below is the actual code. It only

Re: Odd closure issue for generators

2009-06-04 Thread Brian Quinlan
Gabriel Genellina wrote: En Thu, 04 Jun 2009 18:40:07 -0300, Brian Quinlan br...@sweetapp.com escribió: This is from Python built from the py3k branch: It's not new; same thing happens with 2.x A closure captures (part of) the enclosing namespace, so names are resolved in that environment

Re: What text editor is everyone using for Python

2009-06-04 Thread greg
Albert van der Horst wrote: Memories of Atari 260/520/1040 that had a keyboard with a key actually marked ... HELP. Modern day Mac keyboards have one of those, too. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: unladen swallow: python and llvm

2009-06-04 Thread Jesse Noller
You can email these questions to the unladen-swallow mailing list. They're very open to answering questions. 2009/6/4 Luis M. González luis...@gmail.com: I am very excited by this project (as well as by pypy) and I read all their plan, which looks quite practical and impressive. But I must

Re: Making the case for repeat

2009-06-04 Thread Gabriel Genellina
En Thu, 04 Jun 2009 10:37:45 -0300, pataphor patap...@gmail.com escribió: So here is my proposed suggestion for a once and for all reconciliation of various functions in itertools that can not stand on their own and keep a straight face. Because of backwards compatibility issues we cannot

Re: Yet another unicode WTF

2009-06-04 Thread Lawrence D'Oliveiro
In message rnospamon-e7e08b.18181804062...@news.gha.chartermi.net, Ron Garret wrote: Python 2.6.2 on OS X 10.5.7: Same result, Python 2.6.1-3 on Debian Unstable. My $LANG is en_NZ.UTF-8. ... I always thought one of the fundamental invariants of unix processes was that there's no way for a

Re: 2d barcode library?

2009-06-04 Thread Trevor
Christian [1]https://cybernetics.hudora.biz/projects/wiki/huBarcode Thanks guys! huBarcode will work.. -- http://mail.python.org/mailman/listinfo/python-list

Re: Yet another unicode WTF

2009-06-04 Thread Ben Finney
Ron Garret rnospa...@flownet.com writes: According to what I thought I knew about unix (and I had fancied myself a bit of an expert until just now) this is impossible. Python is obviously picking up a different default encoding when its output is being piped to a file, but I always

Re: How do I continue after the error?

2009-06-04 Thread Ben Finney
chad cdal...@gmail.com writes: Let's say I have a list of 5 files. Now lets say that one of the files reads nude333.txt instead of nude3.txt. When this happens, the program generates an error and quits. What I want it to do is just skip over the bad file and continue on with the next one.

Re: Yet another unicode WTF

2009-06-04 Thread Gabriel Genellina
En Thu, 04 Jun 2009 22:18:24 -0300, Ron Garret rnospa...@flownet.com escribió: Python 2.6.2 on OS X 10.5.7: [...@mickey:~]$ echo $LANG en_US.UTF-8 [...@mickey:~]$ cat frob.py #!/usr/bin/env python print u'\u03BB' [...@mickey:~]$ ./frob.py ª [...@mickey:~]$ ./frob.py foo Traceback (most

Re: Yet another unicode WTF

2009-06-04 Thread Ron Garret
In article h09ten$5q...@lust.ihug.co.nz, Lawrence D'Oliveiro l...@geek-central.gen.new_zealand wrote: In message rnospamon-e7e08b.18181804062...@news.gha.chartermi.net, Ron Garret wrote: Python 2.6.2 on OS X 10.5.7: Same result, Python 2.6.1-3 on Debian Unstable. My $LANG is

Re: Yet another unicode WTF

2009-06-04 Thread Ben Finney
Ron Garret rnospa...@flownet.com writes: Python 2.6.2 on OS X 10.5.7: [...@mickey:~]$ echo $LANG en_US.UTF-8 [...@mickey:~]$ cat frob.py #!/usr/bin/env python print u'\u03BB' [...@mickey:~]$ ./frob.py ª [...@mickey:~]$ ./frob.py foo Traceback (most recent call last): File

Re: How do I continue after the error?

2009-06-04 Thread Ben Finney
Ben Finney ben+pyt...@benfinney.id.au writes: You achieve this by one of two methods: Failed to update this statement after an edit. That should be “by following this method”. -- \ “I used to be a proofreader for a skywriting company.” —Steven | `\

Re: import _sqlite3 no module named error

2009-06-04 Thread Ned Deily
In article 77e831100906041718k4b4f54d9v29729449c50f...@mail.gmail.com, Vincent Davis vinc...@vincentdavis.net wrote: On Thu, Jun 4, 2009 at 1:41 PM, Ned Deily n...@acm.org wrote: [...] $ /opt/local/bin/python2.5 Python 2.5.4 (r254:67916, May  4 2009, 01:40:08) [GCC 4.0.1 (Apple Inc. build

Re: __file__ access extremely slow

2009-06-04 Thread Gabriel Genellina
En Thu, 04 Jun 2009 22:24:48 -0300, Zac Burns zac...@gmail.com escribió: The section of code below, which simply gets the __file__ attribute of the imported modules, takes more than 1/3 of the total startup time. Given that many modules are complicated and even have dynamic population this

Re: Odd closure issue for generators

2009-06-04 Thread Michele Simionato
On Jun 5, 1:18 am, Carl Banks pavlovevide...@gmail.com wrote: It's really the only sane way to handle it, odd though it may seem in this narrow case.  In Python nested functions have to be able to reference the current value of a variable because of use cases like this: def func():     def

  1   2   >