Re: Python dynamic attribute creation

2010-06-27 Thread geremy condra
On Sun, Jun 27, 2010 at 6:49 AM, Bruno Desthuilliers wrote: > WANG Cong a écrit : >> On 06/26/10 00:11, Neil Hodgson wrote: >> >>> WANG Cong: >>> 4) Also, this will _somewhat_ violate the OOP princples, in OOP, this is and should be implemented by inherence. >>>    Most object oriented

Extension modules and common routines in Python/C API

2010-06-27 Thread ty ty
Hi, folks! I'm writing wrapper for C library. This library consist of several parts. And i want split my extension package into different extension modules. I think, this is the right way ;-) But, there are some common parts that exist in extension package, get_library_version, Error, and so o

Re: Python dynamic attribute creation

2010-06-27 Thread Stephen Hansen
On 6/27/10 10:10 PM, Carl Banks wrote: On Jun 27, 3:49 am, Bruno Desthuilliers wrote: WANG Cong a écrit : On 06/26/10 00:11, Neil Hodgson wrote: WANG Cong: 4) Also, this will _somewhat_ violate the OOP princples, in OOP, this is and should be implemented by inherence. Most object

Re: Need instruction on how to use isinstance

2010-06-27 Thread Stephen Hansen
On 6/27/10 10:09 PM, alex23 wrote: Stephen Hansen wrote: What the hell? When did that show up? o.O (Did I not pay attention enough during the ABC conversations? It seemed so boring). The PEPs& post-release docs detailing Py3 changes were worth reading, it's noted in the sections on changes t

Re: Need instruction on how to use isinstance

2010-06-27 Thread Chris Rebert
On Sun, Jun 27, 2010 at 9:54 PM, Stephen Hansen wrote: > On 6/27/10 9:30 PM, alex23 wrote: >> Stephen Hansen  wrote: >>> P.S. The removal of callable is something I don't understand in Python >>> 3: while generally speaking I do really believe and use duck typing, I >>> too have on occassion wante

Re: Python dynamic attribute creation

2010-06-27 Thread Carl Banks
On Jun 27, 3:49 am, Bruno Desthuilliers wrote: > WANG Cong a écrit : > > > On 06/26/10 00:11, Neil Hodgson wrote: > > >> WANG Cong: > > >>> 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > >>> this is and should be implemented by inherence. > >>    Most object oriented programmi

Re: Need instruction on how to use isinstance

2010-06-27 Thread alex23
Stephen Hansen wrote: > What the hell? When did that show up? o.O (Did I not pay attention > enough during the ABC conversations? It seemed so boring). The PEPs & post-release docs detailing Py3 changes were worth reading, it's noted in the sections on changes to built-ins: http://www.python.org

Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 9:54 pm, Kushal Kumaran wrote: > On Mon, Jun 28, 2010 at 2:00 AM, Jorgen Grahn > wrote: > > On Sun, 2010-06-27, Lawrence D'Oliveiro wrote: > >> In message , Roy Smith wrote: > > >>> I recently fixed a bug in some production code.  The programmer was > >>> careful to use snprintf() to

Re: I wander which is better? JSP or Python? And is there a place for JSP?

2010-06-27 Thread Chris Rebert
On Sun, Jun 27, 2010 at 9:49 PM, Roger wrote: > As I plan to study JSP, I find it extremly complicated and a part of > J2EE. > I did not attend to get the whole of J2EE. > I hope anybody can describe the future of JSP. > Is there a place for JSP? This is python-list/comp.lang.python; we discuss t

Re: Need instruction on how to use isinstance

2010-06-27 Thread Stephen Hansen
On 6/27/10 9:47 PM, Chris Rebert wrote: There's always: isinstance(, collections.Callable) Why in Guido's name is that in the collections module of all places? What hath callability to do with container objects? What he said! Minus the blasphemy. It's Benevolent _Dictator_ For Life. Not Bene

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > On Jun 27, 8:33 pm, Ben Finney wrote: > > Carl Banks writes: > > > I'm disappointed, usually when you sit on your reinforced soapbox and > > > pretense the air of infinite expertise you at least use reasonable > > > logic. > > > > Kindly stop inventing straw men to attack;

Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Kushal Kumaran
On Mon, Jun 28, 2010 at 2:00 AM, Jorgen Grahn wrote: > On Sun, 2010-06-27, Lawrence D'Oliveiro wrote: >> In message , Roy Smith wrote: >> >>> I recently fixed a bug in some production code.  The programmer was >>> careful to use snprintf() to avoid buffer overflows.  The only problem >>> is, he wr

Re: Need instruction on how to use isinstance

2010-06-27 Thread Stephen Hansen
On 6/27/10 9:30 PM, alex23 wrote: Stephen Hansen wrote: P.S. The removal of callable is something I don't understand in Python 3: while generally speaking I do really believe and use duck typing, I too have on occassion wanted to dispatch based on 'is callable? do x'. Sometimes its not convenie

I wander which is better? JSP or Python? And is there a place for JSP?

2010-06-27 Thread Roger
As I plan to study JSP, I find it extremly complicated and a part of J2EE. I did not attend to get the whole of J2EE. I hope anybody can describe the future of JSP. Is there a place for JSP? -- http://mail.python.org/mailman/listinfo/python-list

[OT] Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Kushal Kumaran
On Sun, Jun 27, 2010 at 5:16 PM, Lawrence D'Oliveiro wrote: > In message , Kushal > Kumaran wrote: > >> On Sun, Jun 27, 2010 at 9:47 AM, Lawrence D'Oliveiro >> wrote: >> >>> In message , Roy Smith wrote: >>> I recently fixed a bug in some production code.  The programmer was careful to

Re: Need instruction on how to use isinstance

2010-06-27 Thread Chris Rebert
On Sun, Jun 27, 2010 at 9:30 PM, alex23 wrote: > Stephen Hansen wrote: >> P.S. The removal of callable is something I don't understand in Python >> 3: while generally speaking I do really believe and use duck typing, I >> too have on occassion wanted to dispatch based on 'is callable? do x'. >> S

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 9:02 pm, Stephen Hansen wrote: > On 6/27/10 8:48 PM, Carl Banks wrote: > > > I don't know the exact details of all of these, but I'm going to opine > > that at least some of these are easily expressible with a function > > call API.  Perhaps more naturally than with string queries.  For

Re: Need instruction on how to use isinstance

2010-06-27 Thread alex23
Stephen Hansen wrote: > P.S. The removal of callable is something I don't understand in Python > 3: while generally speaking I do really believe and use duck typing, I > too have on occassion wanted to dispatch based on 'is callable? do x'. > Sometimes its not convenient to do so via duck typing.

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 8:33 pm, Ben Finney wrote: > Carl Banks writes: > > I'm disappointed, usually when you sit on your reinforced soapbox and > > pretense the air of infinite expertise you at least use reasonable > > logic. > > Kindly stop inventing straw men to attack; I deny the position you're > painti

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
On 2010-06-28 00:02:57 -0400, Stephen Hansen said: On 6/27/10 8:48 PM, Carl Banks wrote: I don't know the exact details of all of these, but I'm going to opine that at least some of these are easily expressible with a function call API. Perhaps more naturally than with string queries. For ins

Re: Why Python3

2010-06-27 Thread John Nagle
On 6/27/2010 8:28 PM, Carl Banks wrote: On Jun 27, 5:12 pm, Terry Reedy wrote: I think that covers the main transitions in core Python. Nice post, but it's missing one thing. The main benefit of Python 3 for Joe Q. Scripter is this: The Python team doesn't have to spend any effort on mainta

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 8:52 pm, Stephen Hansen wrote: > Then there's the type of SQL that results in DBA's having jobs-- and > deservedly so. Its *really* a very flexible and powerful language > capable of doing quite a lot to bend, flex, twist, and interleave that > data in the server while building up a res

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Stephen Hansen
On 6/27/10 8:48 PM, Carl Banks wrote: I don't know the exact details of all of these, but I'm going to opine that at least some of these are easily expressible with a function call API. Perhaps more naturally than with string queries. For instance, set operations: query1 = rdb_query(...) query

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Stephen Hansen
On 6/27/10 7:51 PM, Carl Banks wrote: I'm not the biggest expert on SQL ever, but the only thing I can think of is expressions. Statements don't express anything very complex, and could straightforwardly be represented by function calls. See, there's really two kinds of SQL out there. There's

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 8:19 pm, Owen Jacobson wrote: > On 2010-06-27 22:51:59 -0400, Carl Banks said: > > On Jun 27, 3:20 pm, Roy Smith wrote: > >> In article > >> <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>, > >> Carl Banks wrote: > > >>> Seriously, almost every other kind of library

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread eric dexter
On Jun 27, 8:18 pm, MRAB wrote: > eric dexter wrote: > > On Jun 27, 5:56 pm, MRAB wrote: > >> eric_dex...@msn.com wrote: > >>> I managed to get the program running and the menu options are > >>> appearing on the list but the programs are not running.  I suspect it > >>> is my onexecutemethod > >>

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > On Jun 27, 4:35 pm, Ben Finney wrote: > > Carl Banks writes: > > > Seriously, almost every other kind of library uses a binary API. > > > > Except for the huge number that deal with text protocols or languages. > > No, not really. Almost all types of libraries have binary

Re: Why Python3

2010-06-27 Thread Carl Banks
On Jun 27, 5:12 pm, Terry Reedy wrote: > I think that covers the main transitions in core Python. Nice post, but it's missing one thing. The main benefit of Python 3 for Joe Q. Scripter is this: The Python team doesn't have to spend any effort on maintaining a lot of old obsolete cruft, and can

Re: Need instruction on how to use isinstance

2010-06-27 Thread Stephen Hansen
On 6/27/10 8:04 PM, Steven W. Orr wrote: On 6/27/2010 10:25 PM, Stephen Hansen wrote: On 6/27/10 7:09 PM, Steven W. Orr wrote: So, my question is, what value can I use as the 2nd arg to isinstance to see if foo is a function? And while I'm on the subject, what types does isinstance not support?

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
On 2010-06-27 22:51:59 -0400, Carl Banks said: On Jun 27, 3:20 pm, Roy Smith wrote: In article <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>,  Carl Banks wrote: Seriously, almost every other kind of library uses a binary API. What makes databases so special that they

Re: refactoring a group of import statements

2010-06-27 Thread GrayShark
Thanks for the help Thomas Jollans. Just what I needed. I was wondering what the: __import__(name, globals={}, locals={}, fromlist=[], level=-1) globals was (that was from the docstring on __import__. Odd, the doc on www.python.org has globals as a list, not a dictionary). In any case, I

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
On 6/27/10 7:55 PM, Paul Rubin wrote: Terry Reedy writes: Python3 is about finishing transitions. The last stage in a transition that replaces something old with something new is to remove the old,.. Main problem is that by the time Python3 has stopped being disruptive, Python4 will be underw

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Owen Jacobson
On 2010-06-27 22:51:59 -0400, Carl Banks said: On Jun 27, 3:20 pm, Roy Smith wrote: In article <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>,  Carl Banks wrote: Seriously, almost every other kind of library uses a binary API. What makes databases so special that they

Re: I strongly dislike Python 3

2010-06-27 Thread Steven D'Aprano
On Sun, 27 Jun 2010 16:03:40 -0700, eric_dex...@msn.com wrote: > It should be easier to have a large number of python versions on one > machine... I am realy fond of 2.5 so I am probily going to start > compiling them or just include the python2.5 exe if I port stuff and > settle it that way.. I

Re: Why Python3

2010-06-27 Thread Steven D'Aprano
On Sun, 27 Jun 2010 20:12:10 -0400, Terry Reedy wrote: > 7. Order comparisonS > > In early Python1, I believe all objects could be (arbitrarily) compared > and sorted. When Guido added the complex type, he decided not to add an > arbitrary order, as he thought that could mask bugs. I should poin

Re: I strongly dislike Python 3

2010-06-27 Thread geremy condra
On Sun, Jun 27, 2010 at 10:35 PM, John Bokma wrote: Might as well spare yourself the trouble and install linux or *bsd. It's probably easier. >>> >>> Ah, yeah, and then run all those Windows applications one requires on >>> Wine... >> >> If you're bound to a platform, use it. My advic

Re: Need instruction on how to use isinstance

2010-06-27 Thread Steven W. Orr
On 6/27/2010 10:25 PM, Stephen Hansen wrote: > On 6/27/10 7:09 PM, Steven W. Orr wrote: >> So, my question is, what value can I use as the 2nd arg to isinstance >> to see if >> foo is a function? And while I'm on the subject, what types does >> isinstance not >> support? > > Does it have to be a f

Re: I strongly dislike Python 3

2010-06-27 Thread Paul Rubin
Terry Reedy writes: > Python3 is about finishing transitions. The last stage in a transition > that replaces something old with something new is to remove the old,.. Main problem is that by the time Python3 has stopped being disruptive, Python4 will be underway. Python3 is incompatible enough wi

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 3:20 pm, Roy Smith wrote: > In article > <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>, >  Carl Banks wrote: > > > > > Seriously, almost every other kind of library uses a binary API. What > > makes databases so special that they need a string-command based API? >

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
On 6/27/10 7:35 PM, John Bokma wrote: On top of that, I don't think it's that hard to make a small program that one associates with .py files which checks the first line and feeds the .py to the correct version of Python based on the information in the aformentioned first line. http://effbot.or

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 27, 4:35 pm, Ben Finney wrote: > Carl Banks writes: > > Seriously, almost every other kind of library uses a binary API. > > Except for the huge number that deal with text protocols or languages. No, not really. Almost all types of libraries have binary APIs, including those that deal wi

Re: dynamically modify help text

2010-06-27 Thread Red Forks
Read you doc file and set the __doc__ attr of the object you want to change. On Monday, June 28, 2010, Brian Blais wrote: > Hello, > > I know that the help text for an object will give a description of every > method based on the doc string.  Is there a way to add something to this > text, spec

Re: I strongly dislike Python 3

2010-06-27 Thread John Bokma
geremy condra writes: > On Sun, Jun 27, 2010 at 9:25 PM, John Bokma wrote: >> geremy condra writes: >> >>> On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards >>> wrote: On 2010-06-27, Benjamin Kaplan wrote: >> It should be easier to have a large number of python versions on one >>>

Re: Need instruction on how to use isinstance

2010-06-27 Thread MRAB
Steven W. Orr wrote: I need to test an argument for a few different types. I'm calling my function like this arf = MyFunc(list) What I want to do is to test for whether something is a string, tuple, list or function. It's that last one that's causing me a problem. if isinstance(arg, (str, tup

Re: Need instruction on how to use isinstance

2010-06-27 Thread Stephen Hansen
On 6/27/10 7:09 PM, Steven W. Orr wrote: So, my question is, what value can I use as the 2nd arg to isinstance to see if foo is a function? And while I'm on the subject, what types does isinstance not support? Does it have to be a function? -- There's quite a few things which are function-y en

Re: Why Python3

2010-06-27 Thread geremy condra
On Sun, Jun 27, 2010 at 9:46 PM, MRAB wrote: > Stephen Hansen wrote: >> >> On 6/27/10 6:09 PM, MRAB wrote: >>> >>> Terry Reedy wrote: Another would have been to add but never remove anthing, with the consequence that Python would become increasingly difficult to learn and the i

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread MRAB
eric dexter wrote: On Jun 27, 5:56 pm, MRAB wrote: eric_dex...@msn.com wrote: I managed to get the program running and the menu options are appearing on the list but the programs are not running. I suspect it is my onexecutemethod [snip] #add execute files from the text file list

Re: I strongly dislike Python 3

2010-06-27 Thread geremy condra
On Sun, Jun 27, 2010 at 9:25 PM, John Bokma wrote: > geremy condra writes: > >> On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards >> wrote: >>> On 2010-06-27, Benjamin Kaplan wrote: >>> > It should be easier to have a large number of python versions on one > machine... ?I am realy fond of

Re: Why Python3

2010-06-27 Thread Benjamin Kaplan
On Sun, Jun 27, 2010 at 6:51 PM, eric dexter wrote: > On Jun 27, 7:46 pm, MRAB wrote: >> Stephen Hansen wrote: >> > On 6/27/10 6:09 PM, MRAB wrote: >> >> Terry Reedy wrote: >> >>> Another would have been to add but never remove anthing, with the >> >>> consequence that Python would become increas

Re: I strongly dislike Python 3

2010-06-27 Thread Ben Finney
Terry Reedy writes: > On 6/27/2010 8:41 AM, David Cournapeau wrote: > > I think one point which needs to be emphasized more is what does > > python 3 bring to people. […] > Python3 is about finishing transitions. The last stage in a transition > that replaces something old with something new is

Need instruction on how to use isinstance

2010-06-27 Thread Steven W. Orr
I need to test an argument for a few different types. I'm calling my function like this arf = MyFunc(list) What I want to do is to test for whether something is a string, tuple, list or function. It's that last one that's causing me a problem. if isinstance(arg, (str, tuple, list)): No problem

Re: python source code -> win/dos executable (on linux)

2010-06-27 Thread David Robinow
On Sun, Jun 27, 2010 at 9:16 PM, Lawrence D'Oliveiro wrote: > In message <4c24c152$0$31381$4fafb...@reader1.news.tin.it>, superpollo > wrote: > >> suppose i work in a linux environment, but i would like to ship a >> win/dos executable file from time to time, just for test purposes (my >> "testers"

Re: Why Python3

2010-06-27 Thread eric dexter
On Jun 27, 7:46 pm, MRAB wrote: > Stephen Hansen wrote: > > On 6/27/10 6:09 PM, MRAB wrote: > >> Terry Reedy wrote: > >>> Another would have been to add but never remove anthing, with the > >>> consequence that Python would become increasingly difficult to learn > >>> and the interpreter increasin

Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Owen Jacobson
On 2010-06-26 22:33:57 -0400, Lawrence D'Oliveiro said: In message <2010062522560231540-angrybald...@gmailcom>, Owen Jacobson wrote: It's not hard. It's just begging for a visit from the fuckup fairy. That’s the same fallacious argument I pointed out earlier. In the sense that "using corre

Re: Why Python3

2010-06-27 Thread MRAB
Stephen Hansen wrote: On 6/27/10 6:09 PM, MRAB wrote: Terry Reedy wrote: Another would have been to add but never remove anthing, with the consequence that Python would become increasingly difficult to learn and the interpreter increasingly difficult to maintain with volunteers. I think 2.7 is

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread eric dexter
On Jun 27, 5:56 pm, MRAB wrote: > eric_dex...@msn.com wrote: > > I managed to get the program running and the menu options are > > appearing on the list but the programs are not running.  I suspect it > > is my onexecutemethod > > [snip] > > >         #add execute files from the text file list > >

Re: python source code -> win/dos executable (on linux)

2010-06-27 Thread Grant Edwards
On 2010-06-28, Lawrence D'Oliveiro wrote: > In message <4c24c152$0$31381$4fafb...@reader1.news.tin.it>, superpollo > wrote: > >> suppose i work in a linux environment, but i would like to ship a >> win/dos executable file from time to time, just for test purposes (my >> "testers" are windows user

Re: I strongly dislike Python 3

2010-06-27 Thread Grant Edwards
On 2010-06-28, geremy condra wrote: > On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards > wrote: >> On 2010-06-27, Benjamin Kaplan wrote: >> It should be easier to have a large number of python versions on one machine... ?I am realy fond of 2.5 so I am probily going to start compili

Re: I strongly dislike Python 3

2010-06-27 Thread John Bokma
geremy condra writes: > On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards > wrote: >> On 2010-06-27, Benjamin Kaplan wrote: >> It should be easier to have a large number of python versions on one machine... ?I am realy fond of 2.5 so I am probily going to start compiling them or ju

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
On 6/27/10 6:11 PM, geremy condra wrote: On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards wrote: If you install a real shell on Windows, then the hash-bang line works fine. :) Might as well spare yourself the trouble and install linux or *bsd. It's probably easier. Not at all, bash via msys i

Re: Why Python3

2010-06-27 Thread Stephen Hansen
On 6/27/10 6:09 PM, MRAB wrote: Terry Reedy wrote: Another would have been to add but never remove anthing, with the consequence that Python would become increasingly difficult to learn and the interpreter increasingly difficult to maintain with volunteers. I think 2.7 is far enough in that dire

Re: python source code -> win/dos executable (on linux)

2010-06-27 Thread Lawrence D'Oliveiro
In message <4c24c152$0$31381$4fafb...@reader1.news.tin.it>, superpollo wrote: > suppose i work in a linux environment, but i would like to ship a > win/dos executable file from time to time, just for test purposes (my > "testers" are windows users and don't want to go through the hassle of > inst

Re: I strongly dislike Python 3

2010-06-27 Thread geremy condra
On Sun, Jun 27, 2010 at 8:50 PM, Grant Edwards wrote: > On 2010-06-27, Benjamin Kaplan wrote: > >>> It should be easier to have a large number of python versions on one >>> machine... ?I am realy fond of 2.5 so I am probily going to start >>> compiling them or just include the python2.5 exe if I

Re: Why Python3

2010-06-27 Thread MRAB
Terry Reedy wrote: Some people appear to not understand the purpose of Python3 or more specifically, of the changes that break Python2 code. I attempt here to give a relatively full explanation. SUMMARY: Python3 completes (or makes progress in) several transitions begun in Python2. In parti

Re: I strongly dislike Python 3

2010-06-27 Thread Grant Edwards
On 2010-06-27, Benjamin Kaplan wrote: >> It should be easier to have a large number of python versions on one >> machine... ?I am realy fond of 2.5 so I am probily going to start >> compiling them or just include the python2.5 exe if I port stuff and >> settle it that way.. > > You're on the only

Why Python3

2010-06-27 Thread Terry Reedy
Some people appear to not understand the purpose of Python3 or more specifically, of the changes that break Python2 code. I attempt here to give a relatively full explanation. SUMMARY: Python3 completes (or makes progress in) several transitions begun in Python2. In particular, Python3 bunch

Re: A link to a collection of tutorials on LISP.

2010-06-27 Thread nanothermite911fbibustards
On Jun 27, 4:26 pm, Peter Keller wrote: > In comp.lang.lisp nanothermite911fbibustards > wrote: > > > TROLL is that mythical creature who is looking for gold ? > > Nope, they are the ones that jump out from under bridges and scare little > children cause they feel bad about themselves and need s

Re: refactoring a group of import statements

2010-06-27 Thread rantingrick
On Jun 27, 6:09 pm, Thomas Jollans wrote: > > import Tkinter as tk > > try: > >     import Image #from PIL > >     print 'Using high quality images :)' > > except ImportError: > >     print 'Using low quality images :(' > > As such, that still appears rather useless - the following code doesn't >

Re: problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread MRAB
eric_dex...@msn.com wrote: I managed to get the program running and the menu options are appearing on the list but the programs are not running. I suspect it is my onexecutemethod [snip] #add execute files from the text file list idtool = 400 for e in menuoptions:

Re: I strongly dislike Python 3

2010-06-27 Thread Tim Roberts
Stefan Reich wrote: > >Consider Java as a better example: JDK 1.6 still runs and compiles >everything written for JDK 1.0. That is proper management. And Python has the same management. Python 2.6 still runs and compiles everything written for Python 2.0. If there is ever a JDK 2.0, I'll wager

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Ben Finney
Carl Banks writes: > Seriously, almost every other kind of library uses a binary API. Except for the huge number that deal with text protocols or languages. > What makes databases so special that they need a string-command based > API? Because SQL is a text language. -- \ “In t

Re: A link to a collection of tutorials on LISP.

2010-06-27 Thread Peter Keller
In comp.lang.lisp nanothermite911fbibustards wrote: > TROLL is that mythical creature who is looking for gold ? Nope, they are the ones that jump out from under bridges and scare little children cause they feel bad about themselves and need someone else to feel powerful over. I hope you get be

dynamically modify help text

2010-06-27 Thread Brian Blais
Hello, I know that the help text for an object will give a description of every method based on the doc string. Is there a way to add something to this text, specific to an object, but generated at run- time? I have an object that reads a file, and I would like part of that file to be sh

Re: A link to a collection of tutorials on LISP.

2010-06-27 Thread nanothermite911fbibustards
On Jun 27, 4:20 pm, nanothermite911fbibustards wrote: > On Jun 27, 2:33 pm, Peter Keller wrote: > > > nanothermite911fbibustards wrote: > > > That guys intention is not to spread tutorial, but its a commercial. I > > > clarified its true nature. > > > Fair enough. > > > > Your ilk has special sk

Re: A link to a collection of tutorials on LISP.

2010-06-27 Thread nanothermite911fbibustards
On Jun 27, 2:33 pm, Peter Keller wrote: > nanothermite911fbibustards wrote: > > That guys intention is not to spread tutorial, but its a commercial. I > > clarified its true nature. > > Fair enough. > > > Your ilk has special skill in turning white into black and vice-versa. > > Assuming much the

Re: I strongly dislike Python 3

2010-06-27 Thread Stephen Hansen
On 6/27/10 4:03 PM, eric_dex...@msn.com wrote: On Jun 27, 2:09 pm, "Martin v. Loewis" wrote: The same happened with other kinds of deprecations and removals through the life of 2.x. Some applications where tied to a specific Python release, or to a specific feature that had been deprecated. The

problems getting os.system and wxmenu to read options from a file and then execute

2010-06-27 Thread eric_dex...@msn.com
I managed to get the program running and the menu options are appearing on the list but the programs are not running. I suspect it is my onexecutemethod # Get the GUI stuff import wx # We're going to be handling files and directories import os menufile = open('menufile.txt','r') # Set up some b

Re: I strongly dislike Python 3

2010-06-27 Thread Benjamin Kaplan
On Sun, Jun 27, 2010 at 4:03 PM, eric_dex...@msn.com wrote: > On Jun 27, 2:09 pm, "Martin v. Loewis" wrote: >> > I agree that there may be not much reason to port custom proprietary >> > apps that are working fine and which would hardly benefit from, let >> > alone need, and new Py3 features. >>

Re: refactoring a group of import statements

2010-06-27 Thread Thomas Jollans
On 06/28/2010 12:48 AM, rantingrick wrote: > On Jun 27, 5:18 pm, Thomas Jollans wrote: >> On 06/28/2010 12:06 AM, GrayShark wrote: >>> I have a large list of package files to import. I'm using a try/except >>> test to verify the import. Looks like: > > > >> (1) Don't. If you need the module, th

Re: I strongly dislike Python 3

2010-06-27 Thread eric_dex...@msn.com
On Jun 27, 2:09 pm, "Martin v. Loewis" wrote: > > I agree that there may be not much reason to port custom proprietary > > apps that are working fine and which would hardly benefit from, let > > alone need, and new Py3 features. > > In the long run, there will be a benefit: at some point in the fu

Re: refactoring a group of import statements

2010-06-27 Thread rantingrick
On Jun 27, 5:18 pm, Thomas Jollans wrote: > On 06/28/2010 12:06 AM, GrayShark wrote: > > I have a large list of package files to import. I'm using a try/except > > test to verify the import. Looks like: > (1) Don't. If you need the module, there's no reason to check for > exceptions. Just let t

Re: Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Roy Smith
In article <14e44c9c-04d9-452d-b544-498adfaf7...@d8g2000yqf.googlegroups.com>, Carl Banks wrote: > Seriously, almost every other kind of library uses a binary API. What > makes databases so special that they need a string-command based API? > How about this instead (where this a direct binary i

Re: refactoring a group of import statements

2010-06-27 Thread Thomas Jollans
On 06/28/2010 12:06 AM, GrayShark wrote: > I have a large list of package files to import. I'm using a try/except > test to verify the import. Looks like: > > try: > import abc > except ImportError: > print( "Error importing abc" ) > > I've got many of those segments. I want to try a

Why are String Formatted Queries Considered So Magical?

2010-06-27 Thread Carl Banks
On Jun 24, 6:02 pm, Roy Smith wrote: > In article , >  Lawrence D'Oliveiro wrote: > > > I construct ad-hoc queries all the time. It really isn’t that hard to do > > safely. All you have to do is read the documentation > > I get worried when people talk about how easy it is to do something > safel

refactoring a group of import statements

2010-06-27 Thread GrayShark
I have a large list of package files to import. I'm using a try/except test to verify the import. Looks like: try: import abc except ImportError: print( "Error importing abc" ) I've got many of those segments. I want to try and refactor this part of the code. Trying: f

Re: A link to a collection of tutorials on LISP.

2010-06-27 Thread Öö Tiib
On 28 juuni, 00:12, nanothermite911fbibustards wrote: > On Jun 27, 1:33 pm, Peter Keller  wrote: > > > nanothermite911fbibustards wrote: > > > A single bound pdf document of all the tutorial slides in one SINGLE > > > pdf with bookmarks and plain white background would be of some worth > > > but

Re: Scan until random delimiter.

2010-06-27 Thread Albert Hopkins
On Sun, 2010-06-27 at 22:41 +0200, Laurent Verweijen wrote: > In contrast to java or c python seems not be able to use a random > delimiter. > > In java, you can do: > > > Code: > > import java.util.Scanner > > Scanner sc = new Scanner(System.in).useSeperator(" ") > int a = sc.nextInt() > >

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
>> For the moment, you can encode the string explicitly, and pass a byte >> string. > > That doesn't work I only have 3.1.2 to test at the moment. I suggest trying to use the subprocess module instead. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Scan until random delimiter.

2010-06-27 Thread Laurent Verweijen
In contrast to java or c python seems not be able to use a random delimiter. In java, you can do: Code: import java.util.Scanner Scanner sc = new Scanner(System.in).useSeperator(" ") int a = sc.nextInt() But in python there seems to be no other option then waiting until you see a newline. I

Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Jorgen Grahn
On Sun, 2010-06-27, Lawrence D'Oliveiro wrote: > In message , Roy Smith wrote: > >> I recently fixed a bug in some production code. The programmer was >> careful to use snprintf() to avoid buffer overflows. The only problem >> is, he wrote something along the lines of: >> >> snprintf(buf, strlen

Re: Where is StackPanel in IronPython / .Net 4?

2010-06-27 Thread Ian
Hi Benjamin - and thanks for your reply. I'm now really confused. On 27/06/2010 20:05, Benjamin Kaplan wrote: You don't add references to namespaces. You add references to assemblies and you then you import the namespace. > From the documentation: ''' Namespace: System.Windows.Controls Assemb

Re: os.system: string encoding

2010-06-27 Thread Peter Kleiweg
Martin v. Loewis schreef op de 27e dag van de zomermaand van het jaar 2010: > Am 25.06.2010 17:13, schrieb Peter Kleiweg: > > How do I set the string encoding for os.system to anything other then UTF-8? > > You shouldn't have to set it, as it should use your locale's encoding. > In 3.1.2, it will

Re: Why Is Escaping Data Considered So Magical?

2010-06-27 Thread Jorgen Grahn
On Fri, 2010-06-25, Nobody wrote: > On Fri, 25 Jun 2010 12:15:08 +, Jorgen Grahn wrote: > >> I don't do SQL and I don't even understand the terminology properly >> ... but the discussion around it bothers me. >> >> Do those people really do this? > > Yes. And then some. > > Among web developer

Re: I strongly dislike Python 3

2010-06-27 Thread Martin v. Loewis
> I agree that there may be not much reason to port custom proprietary > apps that are working fine and which would hardly benefit from, let > alone need, and new Py3 features. In the long run, there will be a benefit: at some point in the future (surely years from now), /usr/bin/python will be Py

Re: os.system: string encoding

2010-06-27 Thread Martin v. Loewis
Am 25.06.2010 17:13, schrieb Peter Kleiweg: > How do I set the string encoding for os.system to anything other then UTF-8? You shouldn't have to set it, as it should use your locale's encoding. In 3.1.2, it will. For the moment, you can encode the string explicitly, and pass a byte string. Regar

PresentationCore got deleted again

2010-06-27 Thread Jimmy
For some reason, "PresentationCore" doesn't show up... PresentationCore PresentationCore PresentationCore PresentationCore PresentationCore Jimmy Cao wrote: Wrong reference 27-Jun-10 Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Con

Correction

2010-06-27 Thread Jimmy
It should be "PresentationCore" and "PresentationFramework." For some reason, that first part got deleted in my reply. Jimmy Cao wrote: Wrong reference 27-Jun-10 Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Controls etc namespace.

Wrong reference

2010-06-27 Thread Jimmy
Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Controls etc namespace. Ian Hobson wrote: Where is StackPanel in IronPython / .Net 4? 27-Jun-10 Hi All, According to this page http://msdn.microsoft.com/en-us/library/system.windows.c

Re: Roman Polansky RAPED Semantha Geimer Orally, Analy and Vaginally - TRAUMA for victim is so much that she wants it to be out of sight from her

2010-06-27 Thread nanothermite911fbibustards
On Jun 26, 10:02 pm, small Pox wrote: > Roman Polansky RAPED Semantha Geimer Orally, Analy and Vaginally - > TRAUMA for victim is so much that she wants it to be out of sight from > her > > Full Court Declaration of ROMAN POLANSKY > > http://www.netlexfrance.net/29/09/2009/roman-polanski-a-respect

Re: I strongly dislike Python 3

2010-06-27 Thread Terry Reedy
On 6/27/2010 8:41 AM, David Cournapeau wrote: I think one point which needs to be emphasized more is what does python 3 bring to people. The" what's new in python 3 page" gives the impression that python 3 is about removing cruft. That's a very poor argument to push people to switch. Python3 i

  1   2   >