Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Ian Kelly
On Thu, Jun 24, 2010 at 9:38 PM, Lawrence D'Oliveiro wrote: > In message <2010062422432660794-angrybald...@gmailcom>, Owen Jacobson wrote: > >> Why would I write this when SQLAlchemy, even without using its ORM >> features, can do it for me? > > SQLAlchemy doesn’t seem very flexible. Looking at th

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
[Sent to python-list and CC'd] On Fri, Jun 25, 2010 at 10:31 PM, rantingrick wrote: > Clearly the user is upset and blabbing all sorts of incendiary > nonsense but again and again the good folks at SketchUp stay calm and > always attempt to help. This is how i would like to see this group get >

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 9:28 pm, Steven D'Aprano wrote: > That's the second time that I've noticed you use the term "monkey patch". > I don't think it means what you seem to think it means. You seem to be > using it in the sense of "being patched by monkeys", but that's not the > commonly agreed meaning of mo

Re: YANQUI courts were ALWAYS K A N G A R O O Courts - thats how they carried out GENOCIDE of NATIVES !!!

2010-06-25 Thread n...@bid.nes
On Jun 25, 8:42 pm, nanothermite911fbibustards wrote: > YANQUI courts were ALWAYS   K A N G A R O O   Courts  -  thats how > they carried out GENOCIDE of NATIVES !!! You're stupid as well as biased. "Yanqui" courts are as just as any, and as unjust as many others, but at least our system is

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 20:22, Ian Kelly wrote: > On Fri, Jun 25, 2010 at 12:51 PM, Stephen Hansen > wrote: >>> Using assignments to create an attribute hides metaprogramming behide, >>> while using delattr() exposes it. >> >> I don't understand what you're saying here either. > > I think he's saying that w

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 22:11, Mark Lawrence wrote: > On 25/06/2010 19:23, WANG Cong wrote: >> On 06/25/10 14:31, Richard Thomas wrote: >> >> >> >>> >>> If you desperately want to limit the attribute assignments that can be >>> performed on an object you can set the __slots__ attribute of its >>> type. How

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 19:38, Ethan Furman wrote: > WANG Cong wrote: >> On 06/25/10 15:34, Bruno Desthuilliers >> wrote: >> >>> WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are

YANQUI courts were ALWAYS K A N G A R O O Courts - thats how they carried out GENOCIDE of NATIVES !!!

2010-06-25 Thread nanothermite911fbibustards
YANQUI courts were ALWAYS K A N G A R O O Courts - thats how they carried out GENOCIDE of NATIVES !!! On Jun 25, 8:39 pm, nanothermite911fbibustards wrote: > On Jun 23, 8:32 pm, "k...@att.bi" > > wrote: > > You're absolutely clueless. > > http://www.washingtonpost.com/wp-dyn/co

Re: Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-25 Thread nanothermite911fbibustards
On Jun 23, 8:32 pm, "k...@att.bi" wrote: > You're absolutely clueless. http://www.washingtonpost.com/wp-dyn/content/article/2010/06/25/AR2010062504155.html?hpid=moreheadlines Judge in drilling case held stock in oil company affected by moratorium Giant oil plume lingers below surfa

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
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 programming languages starting with Smalltalk > have allowed adding attributes (addInstVarName)

Re: Python dynamic attribute creation

2010-06-25 Thread Ixokai
On Fri, Jun 25, 2010 at 8:24 PM, WANG Cong wrote: > > Here's the thing: Python doesn't consider creating dynamic attributes > > to be questionable. Python doesn't merely allow for dynamicism, it > > encourages it. And encouraging something means to make it simple. > > > > Understand, but please

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Tim Chase
On 06/25/2010 07:49 PM, Lawrence D'Oliveiro wrote: In the Python example, that would be something like os.popen2(['zcat', '-f', '--', untrusted]). That’s what I mean. Why do people consider input sanitization so hard? It's hard because it requires thinking. Sadly, many of the people I know

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:49 PM, Lawrence D'Oliveiro wrote: > In message , Jorgen Grahn > wrote: > > > I thought it was well-known that the solution is *not* to try to > > sanitize the input -- it's to switch to an interface which doesn't > > involve generating an intermediate executable. In the

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/26/10 03:31, Carl Banks wrote: > On Jun 25, 6:15 am, WANG Cong wrote: >> Hi, list! >> >> I have a doubt about the design of dynamic attribute creation by >> assignments in Python. >> >> As we know, in Python, we are able to create a new attribute of >> a class dynamically by an assignment:

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Robert Kern
On 2010-06-25 19:47 , Lawrence D'Oliveiro wrote: In message, Cameron Simpson wrote: On 25Jun2010 15:38, Lawrence D'Oliveiro wrote: | In message<2010062422432660794-angrybald...@gmailcom>, Owen Jacobson | wrote: |> Why would I write this when SQLAlchemy, even without using its ORM |> feature

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Owen Jacobson
On 2010-06-25 20:49:09 -0400, Lawrence D'Oliveiro said: In message , Jorgen Grahn wrote: I thought it was well-known that the solution is *not* to try to sanitize the input -- it's to switch to an interface which doesn't involve generating an intermediate executable. In the Python example, th

Re: Python dynamic attribute creation

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 19:31:24 -0700, Carl Banks wrote: > I will also tell you that claims like "it's doesn't use good OOP > principles" or "C++ does it that way" carry almost no credit. How C++ > does something is a suggestion, nothing more. And sometimes a horrible warning *wink* -- Steven --

Re: importing modules from higher level directory

2010-06-25 Thread Tom Pacheco
from .. import module or from ..module import foo this is intended for use within packages. see http://www.python.org/dev/peps/pep-0328/ also search for python relative import - tom Nathan Huesken wrote: Hi, Is it somehow possible to import modules from *.py files in a higher level directo

Re: Python dynamic attribute creation

2010-06-25 Thread Carl Banks
On Jun 25, 6:15 am, WANG Cong wrote: > Hi, list! > > I have a doubt about the design of dynamic attribute creation by > assignments in Python. > > As we know, in Python, we are able to create a new attribute of > a class dynamically by an assignment: > > > > >>> class test: pass > ... > >>> test.a

Re: best way to increment an IntVar?

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 17:00:37 -0700, rantingrick wrote: > Looks like the dev cycle is completely "idle" at this point and > suffering the fate of monkey patch syndrome. That's the second time that I've noticed you use the term "monkey patch". I don't think it means what you seem to think it means

Re: ANN: 'tsearchpath' Path Search Module, Version 1.08 Released

2010-06-25 Thread Tim Daneliuk
On 6/25/2010 7:23 PM, Dog Walker wrote: > On Fri, Jun 25, 2010 at 10:44 AM, Tim Daneliuk wrote: >> 'tsearchpath' Version 1.108 is now released and available for download at: >> >> http://www.tundraware.com/Software/tsearchpath >> >> -

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Lawrence D'Oliveiro
In message , Jorgen Grahn wrote: > I thought it was well-known that the solution is *not* to try to > sanitize the input -- it's to switch to an interface which doesn't > involve generating an intermediate executable. In the Python example, > that would be something like os.popen2(['zcat', '-f',

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Lawrence D'Oliveiro
In message , Cameron Simpson wrote: > On 25Jun2010 15:38, Lawrence D'Oliveiro > wrote: > > | In message <2010062422432660794-angrybald...@gmailcom>, Owen Jacobson > | wrote: > > | > Why would I write this when SQLAlchemy, even without using its ORM > | > features, can do it for me? > | > | SQLA

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 5:00 PM, rantingrick wrote: > However i'm not about to waste my time > if i cannot get the code accepted into the stdlib because "some > people" here hate me. > Please get over yourself, dude. No one believes this martyrdom schtick you've taken on since you snuck away fro

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Roy Smith
In article , Ian Kelly wrote: > On Fri, Jun 25, 2010 at 5:17 PM, Nobody wrote: > > To be fair, it isn't actually limited to web developers. I've seen the > > following in scientific code written in C (or, more likely, ported to C > > from Fortran) for Unix: > > > >        sprintf(buff, "rm -f %

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Lawrence D'Oliveiro
In message , Nobody wrote: > On Fri, 25 Jun 2010 12:25:56 +1200, Lawrence D'Oliveiro wrote: > >> I construct ad-hoc queries all the time. It really isn’t that hard to >> do safely. > > Wrong. > > Even if you get the quoting absolutely correct (which is a very big "if"), > you have to remember t

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Ian Kelly
On Fri, Jun 25, 2010 at 5:17 PM, Nobody wrote: > To be fair, it isn't actually limited to web developers. I've seen the > following in scientific code written in C (or, more likely, ported to C > from Fortran) for Unix: > >        sprintf(buff, "rm -f %s", filename); >        system(buff); Tsk, t

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-25 Thread Tassilo Horn
Xah Lee writes: > Tassilo, i use google groups to read news, so i don't see any form > feed. Don't think i can see them in any or most web based interface. Real men don't use web interfaces. ;-) > Just checked gmane.org it also doesn't show. With google group, if you > view the message raw, it'

Re: ANN: 'tsearchpath' Path Search Module, Version 1.08 Released

2010-06-25 Thread Dog Walker
On Fri, Jun 25, 2010 at 10:44 AM, Tim Daneliuk wrote: > 'tsearchpath' Version 1.108 is now released and available for download at: > >         http://www.tundraware.com/Software/tsearchpath > > - > > What's New In This Release? >

Re: improving python performance by extension module (64bit)

2010-06-25 Thread geremy condra
On Fri, Jun 25, 2010 at 6:18 PM, Mark Lawrence wrote: > On 25/06/2010 22:25, Stephen Hansen wrote: >> >> On Fri, Jun 25, 2010 at 1:51 PM, Mark >> Lawrencewrote: >> >>> On 25/06/2010 16:34, Stephen Hansen wrote: >>> >>>  Python's slow, sure. But its in practice fast enough for an extremely >>>

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 5:15 pm, Emile van Sebille wrote: > > I AM rewriting it, however i am heavily contemplating whether i will > > or will not share the code with such ungrateful heathens. > > Idle is dead -- long live idlefork! Thanks Emile for sharing this. Nobody had told me about the IDLE fork projec

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 6:09 pm, a...@pythoncraft.com (Aahz) wrote: > >Normal dross from a complete and utter moron.  Thankfully one completely > >useless idiot doesn't make a community.  As I have suffered from > >physical and mental health problems for some years I reckon I do quite > >well. You, sadly, are

Re: [ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread John Nagle
On 6/25/2010 4:14 PM, Paul Rubin wrote: I only had a couple minutes to look at it (maybe more during the weekend). It looks interesting. I wonder whether Python is really the right host language for it. How do you handle nested objects whose outermost layer is immutable but whose contents are

Re: Using Classes

2010-06-25 Thread Mag Gam
Thanks everyone for your responses. They were very useful and I am glad I asked the question. I think having a concrete example would help me better, lets say I have this. Trian A, Arrived at 6:00AM Jun 25, Left at 8:00AM Jun 25 Trian B, Arrived at 2:00AM Jun 26, Left at 12:00AM Jun 26 Trian C,

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 5:03 pm, Mark Lawrence wrote: > > Some of you don't care about IDLE, well thats fine, but you should > > care about the stdlib being clean and up to date. > > Normal dross from a complete and utter moron.  Thankfully one completely > useless idiot doesn't make a community. You, sadly,

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread Nobody
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 developers, the median level of programming knowledge am

Re: [ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread Paul Rubin
I only had a couple minutes to look at it (maybe more during the weekend). It looks interesting. I wonder whether Python is really the right host language for it. How do you handle nested objects whose outermost layer is immutable but whose contents are potentially mutable? An obvious example is

Re: Python dynamic attribute creation

2010-06-25 Thread Neil Hodgson
WANG Cong: > 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > this is and should be implemented by inherence. Most object oriented programming languages starting with Smalltalk have allowed adding attributes (addInstVarName) to classes at runtime. Low level OOPLs like C++ and

Re: best way to increment an IntVar?

2010-06-25 Thread Aahz
In article , Mark Lawrence wrote: > >Normal dross from a complete and utter moron. Thankfully one completely >useless idiot doesn't make a community. As I have suffered from >physical and mental health problems for some years I reckon I do quite >well. You, sadly, are beyond redemption. Ple

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 3:18 PM, Mark Lawrence wrote: > On 25/06/2010 22:25, Stephen Hansen wrote: > >> On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence> >wrote: >> >> On 25/06/2010 16:34, Stephen Hansen wrote: >>> >>> Python's slow, sure. But its in practice fast enough for an extremely >>>

Re: deprecated string module issue

2010-06-25 Thread Robert Kern
On 6/25/10 4:31 PM, GrayShark wrote: Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or worse luck, no one on the other side to create a wrong side? As to your comment about Logilab's pylint. I'v seen a ticket similar to this from three months back. I assume they're not fix

Re: deprecated string module issue

2010-06-25 Thread Stephen Hansen
Uhh... On Fri, Jun 25, 2010 at 2:31 PM, GrayShark wrote: > As to your comment about Logilab's pylint. I'v seen a ticket similar to > this from three months back. I assume they're not fixing it because if > you review 'string' via pydoc you'd read this: > > ---

Re: deprecated string module issue

2010-06-25 Thread Mark Lawrence
First up please don't top post. Second (although I'm sure Terry Reedy can speak for himself) said TJR has put more into Python than I've drunk pints of beer, and that's saying something, so you accusing him of being rude to me stinks!!! Please apologise or get off of this ng/ml. Disgusted.

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/25/2010 3:52 PM, Dave Angel wrote: I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about. I have no idea what "default behavior" is

Re: importing modules from higher level directory

2010-06-25 Thread Emile van Sebille
On 6/25/2010 2:20 PM Nathan Huesken said... Hi, Is it somehow possible to import modules from *.py files in a higher level directory? Intuitively I would do import ../module but that does not work. How does it work? IIRC, sys.path controls the search order. You could insert your preferred

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Mark Lawrence
On 25/06/2010 22:25, Stephen Hansen wrote: On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrencewrote: On 25/06/2010 16:34, Stephen Hansen wrote: Python's slow, sure. But its in practice fast enough for an extremely broad range of activities. What? What, what? --S Python is *NOT* slow,

Re: best way to increment an IntVar?

2010-06-25 Thread Emile van Sebille
On 6/25/2010 1:07 PM rantingrick said... On Jun 25, 12:36 pm, Emile van Sebille wrote: IIRC, IDLE was written by Guido so that he could experience writing in python (which he also wrote). _You_ can either rewrite it or not, but realize no one else is going to do it, so stop wasting your time

Re: deprecated string module issue

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 16:31:17 -0500, GrayShark wrote: > Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or > worse luck, no one on the other side to create a wrong side? I see only one person being rude here, and that's you. Terry made the very reasonable observation that yo

Re: importing modules from higher level directory

2010-06-25 Thread Nathan Rice
Add the parent directory to your sys.path... On Fri, Jun 25, 2010 at 5:20 PM, Nathan Huesken wrote: > Hi, > > Is it somehow possible to import modules from *.py files in a higher > level directory? > Intuitively I would do > > import ../module > > but that does not work. > How does it work? > > T

Re: best way to increment an IntVar?

2010-06-25 Thread Mark Lawrence
On 25/06/2010 21:26, rantingrick wrote: On Jun 25, 12:46 pm, Alan G Isaac wrote: On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue?http://bugs.python.org/ If *I* open an issue it will be ignored or q

Re: hex question

2010-06-25 Thread Dave Angel
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? You don't say what you do want. Currently, you have a literal that describes four characters. Were you tryin

Re: deprecated string module issue

2010-06-25 Thread GrayShark
Why the rudness Terry Jan Reedy? Get up on the wrong side of the bed? Or worse luck, no one on the other side to create a wrong side? As to your comment about Logilab's pylint. I'v seen a ticket similar to this from three months back. I assume they're not fixing it because if you review 'string

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:51 PM, Mark Lawrence wrote: > On 25/06/2010 16:34, Stephen Hansen wrote: > > Python's slow, sure. But its in practice fast enough for an extremely >> broad >> range of activities. >> >> > What? > What, what? --S -- http://mail.python.org/mailman/listinfo/python-list

importing modules from higher level directory

2010-06-25 Thread Nathan Huesken
Hi, Is it somehow possible to import modules from *.py files in a higher level directory? Intuitively I would do import ../module but that does not work. How does it work? Thanks! Nathan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python dynamic attribute creation

2010-06-25 Thread Mark Lawrence
On 25/06/2010 19:23, WANG Cong wrote: On 06/25/10 14:31, Richard Thomas wrote: If you desperately want to limit the attribute assignments that can be performed on an object you can set the __slots__ attribute of its type. However, the Python ethos has always been to restrict as little as ne

Re: hex question

2010-06-25 Thread Matt McCredie
Sneaky Wombat gmail.com> writes: > > Why is python turning \x0a into a \n ? > > In [120]: h='\x0a\xa8\x19\x0b' > > In [121]: h > Out[121]: '\n\xa8\x19\x0b' > > I don't want this to happen, can I prevent it? 'h' is an ascii string. The ascii encoding for '\n' is the number(byte) 0x0A. When y

Re: Python dynamic attribute creation

2010-06-25 Thread Mark Lawrence
On 25/06/2010 19:03, WANG Cong wrote: [lots of snips] "Happily mixes them all together" doesn't mean it is elegant. :) Bollocks springs to my mind. :) Kindest regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: improving IDLE

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! On Jun 25, 12:46 pm, Alan G Isaac wrote: Did you open an issue?http://bugs.python.org/ On 6/25/2010 4:26 PM, rantingrick wrote: If *I* open an issue it will be ignored

Re: best way to increment an IntVar?

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 1:26 PM, rantingrick wrote: > On Jun 25, 12:46 pm, Alan G Isaac wrote: > > On 6/25/2010 1:24 PM, rantingrick wrote: > > > > > the "if __name__ == '__main__' tests" use > > > root.quit instead of root.destroy! > > > > Did you open an issue?http://bugs.python.org/ > > If *I

Re: Heuristic

2010-06-25 Thread Mark Lawrence
Please stop top posting!!! On 25/06/2010 15:14, Nathan Rice wrote: I solve optimization problems like this all the time using branch and bound. Just arrange the possible scenarios into a state space tree, (ideally ordered by lowest average cost supplier) then prune any branch where the best case

Re: improving python performance by extension module (64bit)

2010-06-25 Thread Mark Lawrence
On 25/06/2010 16:34, Stephen Hansen wrote: Python's slow, sure. But its in practice fast enough for an extremely broad range of activities. What? Kindest regards. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 3:52 PM, Dave Angel wrote: I said "default", not "only" behavior. I suspect list provides an __iadd__ method to provide this ability. Integers do not, and therefore neither does the object the OP was asking about. I have no idea what "default behavior" is supposed to mean. Mut

value of: None is None is None

2010-06-25 Thread Alan G Isaac
Surprising for a moment, if you don't immediatelyrecognize it as a chained comparison. (Just sharing.) Alan Isaac None is None is None True (None is None) is None False None is (None is None) False -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Mark Lawrence
Please don't top post! On 25/06/2010 15:20, Shashwat Anand wrote: why do you need that ? which platform are you onto ? On OSX you can use 'DictionaryServices' API eg., import sys import DictionaryServices word = " ".join(sys.argv[1:]) print DictionaryServices.DCSCopyTextDefinition(None, word,

Re: hex question

2010-06-25 Thread Ethan Furman
Sneaky Wombat wrote: Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? '\x0a' == '\n' -- http://mail.python.org/mailman/listinfo/python-list

Re: hex question

2010-06-25 Thread Emile van Sebille
On 6/25/2010 1:20 PM Sneaky Wombat said... Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? It's not happening. What you're seeing is the representation of the four bytes, and \x0a

Re: Emacs Form Feed (^L) Display Suggestion and Tips

2010-06-25 Thread Xah Lee
On Jun 24, 11:12 am, Tassilo Horn wrote: > Xah Lee writes: > > Hi Xah, > > > also, besides emacs elisp, does anyone see the form feed char in other > > lang source code? > > It's quite often used in messages in newsgroups and mailing lists.  The > Gnus news- and mailreader creates nice "Next/Prev

[ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread John Nagle
We have just released a proof-of-concept implementation of a new approach to thread management - "newthreading". It is available for download at https://sourceforge.net/projects/newthreading/ The user's guide is at http://www.animats.com/papers/languages/newthreadingintro.html This is

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 12:46 pm, Alan G Isaac wrote: > On 6/25/2010 1:24 PM, rantingrick wrote: > > > the "if __name__ == '__main__' tests" use > > root.quit instead of root.destroy! > > Did you open an issue?http://bugs.python.org/ If *I* open an issue it will be ignored or quickly dismissed because the peo

hex question

2010-06-25 Thread Sneaky Wombat
Why is python turning \x0a into a \n ? In [120]: h='\x0a\xa8\x19\x0b' In [121]: h Out[121]: '\n\xa8\x19\x0b' I don't want this to happen, can I prevent it? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help on finding word is valid as per English Dictionary through python

2010-06-25 Thread Terry Reedy
On 6/25/2010 9:30 AM, anu python wrote: Hi, I have a text file , a.txt this is a lcose button where u can observer "lcose" is not a valid word.It's typing mistake.Actual word is "close". How can i check that each word entered in txt file having correct

Re: deprecated string module issue

2010-06-25 Thread Terry Reedy
On 6/25/2010 10:02 AM, GrayShark wrote: Thanks for the suggestion. I gave it a quick try. Same 'warning'. No, using the string module is the issue. Perhaps I'll just ignore it. And what about the next naive user of pylint? Submitting a bug report to the author of pylint would take much less t

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 12:36 pm, Emile van Sebille wrote: > IIRC, IDLE was written by Guido so that he could experience writing in > python (which he also wrote).  _You_ can either rewrite it or not, but > realize no one else is going to do it, so stop wasting your time asking > for it to be rewritten. I AM

Re: best way to increment an IntVar?

2010-06-25 Thread Terry Reedy
On 6/25/2010 10:12 AM, Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. tkinter was wri

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac I said "default", not "only" behavior. I suspect list provides an

Re: Python dynamic attribute creation

2010-06-25 Thread Ian Kelly
On Fri, Jun 25, 2010 at 12:51 PM, Stephen Hansen wrote: >> Using assignments to create an attribute hides metaprogramming behide, >> while using delattr() exposes it. > > I don't understand what you're saying here either. I think he's saying that when an attribute exists in the class dictionary,

[ANN]: "newthreading" - an approach to simplified thread usage, and a path to getting rid of the GIL

2010-06-25 Thread John Nagle
We have just released a proof-of-concept implementation of a new approach to thread management - "newthreading". It is available for download at https://sourceforge.net/projects/newthreading/ The user's guide is at http://www.animats.com/papers/languages/newthreadingintro.html This is

(test - ignore)

2010-06-25 Thread John Nagle
Having posting problems - ignore -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Is Escaping Data Considered So Magical?

2010-06-25 Thread John Nagle
On 6/25/2010 12:09 AM, Paul Rubin wrote: Nobody writes: More generally, as a program gets more complex, "this will work so long as we do X every time without fail" approaches "this won't work". Yes. I was just looking at some of my own code. Out of about 100 SQL statements, I'd used manu

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 11:03 AM, WANG Cong wrote: > On 06/25/10 17:25, Steven D'Aprano > wrote: > > > Yes, isn't it wonderful? In other languages, metaprogramming is deepest > > black magic, or even completely impossible. In Python it is so easy that > > anyone can do it, and it is something beg

Re: Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-25 Thread small Pox
US Senators Urge Obama To Stand By Israel By Ma'an News 25 June, 2010 Ma'an News Bethlehem – Ma’an – In a letter, 87 American senators told President Barack Obama that the US "must continue" to stand with Israel. In a senate of 100 members, the group of 87 represents a strong majority. Declarin

Re: How to get the date format from the users locale?

2010-06-25 Thread Chris Rebert
On Fri, Jun 25, 2010 at 4:39 AM, Fabio Zadrozny wrote: > I'm trying to get the locale-aware date format but it doesn't seem to > be available through nl_langinfo in python 2.5.4 (windows vista). There is the %x format specifier in the time module, but it doesn't actually tell you the format, it m

Re: Jew JUDGE shows off JEW POWER by BULLYING and BLACKMAILING a BLACK PRESIDENT OBAMA

2010-06-25 Thread small Pox
On Jun 22, 8:30 pm, small Pox wrote: > Jew Judges NEVER came out against the CRIMES of BUSH and CHENEY and > LARRY    S I L V E R    S T E I N   -   The main player in 911 > > Jews are coming out from the directions of Corporations, Mafias, > Legislators, and now Judge to SUBVERT the UNITED STATES

Re: Python dynamic attribute creation

2010-06-25 Thread Ethan Furman
WANG Cong wrote: On 06/25/10 15:34, Bruno Desthuilliers wrote: WANG Cong a écrit : Hi, list! I have a doubt about the design of dynamic attribute creation by assignments in Python. As we know, in Python, we are able to create a new attribute of a class dynamically by an assignment: class

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 14:31, Richard Thomas wrote: > > If you desperately want to limit the attribute assignments that can be > performed on an object you can set the __slots__ attribute of its > type. However, the Python ethos has always been to restrict as little > as necessary to provide the tools it

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 15:34, Bruno Desthuilliers wrote: > WANG Cong a écrit : >> Hi, list! >> >> I have a doubt about the design of dynamic attribute creation by >> assignments in Python. >> >> As we know, in Python, we are able to create a new attribute of >> a class dynamically by an assignment: >>

Re: Python dynamic attribute creation

2010-06-25 Thread WANG Cong
On 06/25/10 17:25, Steven D'Aprano wrote: > On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote: > >> Hi, list! >> >> I have a doubt about the design of dynamic attribute creation by >> assignments in Python. >> >> As we know, in Python, we are able to create a new attribute of a class >> dynam

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:24 PM, rantingrick wrote: the "if __name__ == '__main__' tests" use root.quit instead of root.destroy! Did you open an issue? http://bugs.python.org/ Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Alan G Isaac
On 6/25/2010 1:14 PM, Dave Angel wrote: the default behavior of += is to assign a new object with the new value, rather than changing the previous object. a = [] temp = a a += [2] temp [2] Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: best way to increment an IntVar?

2010-06-25 Thread Emile van Sebille
On 6/25/2010 10:24 AM rantingrick said... On Jun 25, 9:12 am, Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a g

Re: Python 2.7, tkinter problem on OSX

2010-06-25 Thread Jeff Hobbs
On Jun 25, 1:54 am, Julien Pauty wrote: > Last version of my software relies on ttk. Under windows and linux > this is fine. But, OSX users are facing problems (I don't have access > to a Mac myself for testing...). Those with OSX 10.6 can run the > program. It seems that OSX 8.6 ships with Tk8.5.

Re: best way to increment an IntVar?

2010-06-25 Thread rantingrick
On Jun 25, 9:12 am, Alan G Isaac wrote: > On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: > > > It is NOT a numeric "variable" in Python realms. > > Sure, but why does it not behave more like one? > It seems both obvious and desirable, so I'm > guessing there is a good reason not to do it. This is

Re: best way to increment an IntVar?

2010-06-25 Thread Dave Angel
Alan G Isaac wrote: On 6/24/2010 1:59 AM, Dennis Lee Bieber wrote: It is NOT a numeric "variable" in Python realms. Sure, but why does it not behave more like one? It seems both obvious and desirable, so I'm guessing there is a good reason not to do it. So var+=increment can't be used be

Re: Continuously running scripts question

2010-06-25 Thread Kushal Kumaran
- Original message - > Currently, I have some scripts (in particular, applescript > 'stay-open' scripts) that run continuously on a Mac through > the day.  They look in a certain folder every 30 seconds and > perform the necessary work needed. > Take a look at inotify. Maybe it fits

Re: Python dynamic attribute creation

2010-06-25 Thread Stephen Hansen
On Fri, Jun 25, 2010 at 6:15 AM, WANG Cong wrote: > 4) Also, this will _somewhat_ violate the OOP princples, in OOP, > this is and should be implemented by inherence. > Others have answered the rest fine, I just wanted to add: Who says we have to follow OOP principles, huh? If you want to follo

followup links (Re: Continuously running scripts question)

2010-06-25 Thread Tim Harig
On 2010-06-25, Tim Harig wrote: > It sounds to me, since your script is acting on an event, that it > would benefit from using something like inotify, or whatever your > system equivilant would be (FSEvents for Mac? FAM framework for general > POSIX. There are python modules available.), so that y

Re: Continuously running scripts question

2010-06-25 Thread Tim Harig
On 2010-06-25, wrote: [order modified] > I was curious if anyone here on the list does anything similar > with Python? If so, do you use launchd, cron, etc in order to > start up your Python script at the appropriate time(s)? Or do > you just let your Python code run continuously? I'm curi

Re: Python dynamic attribute creation

2010-06-25 Thread Steven D'Aprano
On Fri, 25 Jun 2010 14:15:12 +0100, WANG Cong wrote: > Hi, list! > > I have a doubt about the design of dynamic attribute creation by > assignments in Python. > > As we know, in Python, we are able to create a new attribute of a class > dynamically by an assignment: > class test: pass > ..

Re: Continuously running scripts question

2010-06-25 Thread Ian Kelly
On Fri, Jun 25, 2010 at 9:49 AM, wrote: > Currently, I have some scripts (in particular, applescript > 'stay-open' scripts) that run continuously on a Mac through > the day.  They look in a certain folder every 30 seconds and > perform the necessary work needed. > > I was curious if anyone here o

Re: GDAL-1.7.1 : vcvarsall.bat missing

2010-06-25 Thread Max Erickson
kBob wrote: > On Jun 25, 1:26 am, Mark Lawrence > wrote: >> On 24/06/2010 21:48, Christian Heimes wrote: >> >> >>   I am attempting to install the GDAL bindings (GDAL-1.7.1) >> >> on a Windows XP Desktop with Python 2.6 and GDAL. During >> >> install, the If it suits your needs, you can wire

  1   2   >