Re: Python as a scripting language. Alternative to bash script?

2010-07-01 Thread Dave Pawson
I'm the OP btw. On 1 July 2010 18:10, Dennis Lee Bieber wrote: >> I think that Python "could" be a alternative to bash and have some >> advantages, but it's a long way off from being fully implemented. > >        While a somewhat klutzier language in aspects (the , is both an > parameter separat

Re: automate minesweeper with python

2010-07-01 Thread Ian Kelly
On Thu, Jul 1, 2010 at 7:17 PM, Terry Reedy wrote: > Did you actually try it? Though skeptical, I did, briefly, until I decided > that it probably should have been dated April 1. There is no way to enter > text into minesweeper, nor to make it full screen, nor, as far as I know, > for it to toggle

Re: Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-01 Thread Steve
On Jul 2, 4:48 am, pyt...@bdurham.com wrote: > Curious if any of you are using GPG or PGP encryption and/or signatures > in your Python apps? > > In particular are you: > > 1. clearsigning specific emails? > 2. validating clearsigned emails from others? > 3. encrypting/decrypting files? > 4. genera

Re: Is there a reference manual for "pyparsing"?

2010-07-01 Thread Chris Rebert
On Thu, Jul 1, 2010 at 10:08 PM, John Nagle wrote: > On 7/1/2010 10:02 PM, Chris Rebert wrote: >> On Thu, Jul 1, 2010 at 9:50 PM, John Nagle  wrote: >>>  Is there a reference manual for "pyparsing"?  Not a tutorial.  Not a >>> wiki. >>> Not a set of examples.  Not a "getting started guide". >>> So

Re: Is there a reference manual for "pyparsing"?

2010-07-01 Thread John Nagle
On 7/1/2010 10:02 PM, Chris Rebert wrote: On Thu, Jul 1, 2010 at 9:50 PM, John Nagle wrote: Is there a reference manual for "pyparsing"? Not a tutorial. Not a wiki. Not a set of examples. Not a "getting started guide". Something that actually documents what each primitive does? http://py

Re: Why defaultdict?

2010-07-01 Thread Raymond Hettinger
On Jul 1, 9:11 pm, Steven D'Aprano wrote: > I would like to better understand some of the design choices made in > collections.defaultdict. . . . > If callable is None, defaultdicts are > *exactly* equivalent to built-in dicts, so I wonder why the API wasn't > added on to dict rather than a separ

Re: Is there a reference manual for "pyparsing"?

2010-07-01 Thread Chris Rebert
On Thu, Jul 1, 2010 at 9:50 PM, John Nagle wrote: >  Is there a reference manual for "pyparsing"?  Not a tutorial.  Not a wiki. > Not a set of examples.  Not a "getting started guide". > Something that actually documents what each primitive does? http://pyparsing.svn.sourceforge.net/viewvc/pypars

Is there a reference manual for "pyparsing"?

2010-07-01 Thread John Nagle
Is there a reference manual for "pyparsing"? Not a tutorial. Not a wiki. Not a set of examples. Not a "getting started guide". Something that actually documents what each primitive does? John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: Why defaultdict?

2010-07-01 Thread Chris Rebert
On Thu, Jul 1, 2010 at 9:11 PM, Steven D'Aprano wrote: > I would like to better understand some of the design choices made in > collections.defaultdict. Perhaps python-dev should've been CC-ed... > Firstly, to initialise a defaultdict, you do this: > > from collections import defaultdict > d = d

Re: OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-01 Thread John Doe
André wrote: > ... set it up so that linenumbers are shown, then you get a much > larger target to click and select the line. Yes... And it allows clicking and dragging the number area to select multiple lines. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Why defaultdict?

2010-07-01 Thread Steven D'Aprano
I would like to better understand some of the design choices made in collections.defaultdict. Firstly, to initialise a defaultdict, you do this: from collections import defaultdict d = defaultdict(callable, *args) which sets an attribute of d "default_factory" which is called on key lookups wh

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

2010-07-01 Thread Rami Chowdhury
On Thursday 01 July 2010 16:50:59 Lawrence D'Oliveiro wrote: > Nevertheless, it it at least self-consistent. To return to my original > macro: > > #define Descr(v) &v, sizeof v > > As written, this works whatever the type of v: array, struct, whatever. > Doesn't seem to, sorry. Using Michae

Re: automate minesweeper with python

2010-07-01 Thread Emile van Sebille
On 7/1/2010 6:17 PM Terry Reedy said... On 7/1/2010 6:42 PM, Emile van Sebille wrote: On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. ... or, you could al

Re: Ignorance and Google Groups (again)

2010-07-01 Thread D'Arcy J.M. Cain
On Thu, 1 Jul 2010 21:34:15 +0300 Dotan Cohen wrote: > I'm one of them. Gmail is great for mailing lists, though I would > never use it as a personal email client. But I'm more of a lurker than > a poster on this list, so D'Arcy won't miss me anyway. As the song says. "How can I miss you if you w

Re: Python v3.1.2 documentation question

2010-07-01 Thread Terry Reedy
On 7/1/2010 6:42 PM, Ethan Furman wrote: Hmmm Well, as this is my first ever bug post (yay! ;) Great! > I *think* this is what you want: http://bugs.python.org/issue9121 I believe Benjamin meant that it was already fixed in http://docs.python.org/dev/py3k/ which is currently the 3.2a0

Re: Python dynamic attribute creation

2010-07-01 Thread Chris Rebert
On Thu, Jul 1, 2010 at 6:10 PM, Steven D'Aprano wrote: > Engineers are quite > happy to make the tools they need to make the tools they need to make the > tools they need to make something. Carpenters would think you were crazy > if you said that building a scaffold was "meta-carpentry" and there

Re: Composition of functions

2010-07-01 Thread Terry Reedy
On 7/1/2010 3:54 AM, Stephen Hansen wrote: On 7/1/10 12:45 AM, Terry Reedy wrote: On 7/1/2010 12:32 AM, Mladen Gogala wrote: On Wed, 30 Jun 2010 21:04:28 -0700, Stephen Hansen wrote: However, you can easily get what you want by using the 'reversed' function (and similarly, the 'sorted' funct

Re: automate minesweeper with python

2010-07-01 Thread Terry Reedy
On 7/1/2010 6:42 PM, Emile van Sebille wrote: On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. ... or, you could always win... http://www.daniweb.com/forum

Re: Python dynamic attribute creation

2010-07-01 Thread Steven D'Aprano
On Thu, 01 Jul 2010 23:46:55 +0800, WANG Cong wrote: > However, I think setattr() is a builtin function, using it exposes the > *magic* of metaprogramming (or class-programming, if more correct) at a > first glance. There's nothing magic about metaprogramming. If you're a programmer, you write p

Re: OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-01 Thread André
On Jul 1, 1:39 pm, John Doe wrote: > Is there a way to increase the line selection gutter width? It > seems to be only one pixel wide. In other words... When I single > click on the left side of the line, in order to automatically > select the line, the pointer must be in a precise single pixel >

Re: Python v3.1.2 documentation question

2010-07-01 Thread Aahz
In article , Ethan Furman wrote: >Aahz wrote: >> In article , >> Ethan Furman wrote: >>> Stephen Hansen wrote: On 6/29/10 10:01 AM, Ethan Furman wrote: > In the glossary section it states: > > > nested scope > > The ability to refer to a variable in an enclosing de

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

2010-07-01 Thread Lawrence D'Oliveiro
In message <4c2ccd9c$0$1643$742ec...@news.sonic.net>, John Nagle wrote: > The approach to arrays in C is just broken, for historical reasons. Nevertheless, it it at least self-consistent. To return to my original macro: #define Descr(v) &v, sizeof v As written, this works whatever the type

Re: Why Is Escaping Data Considered So Magical?

2010-07-01 Thread Lawrence D'Oliveiro
In message , Michael Torrie wrote: > On 06/29/2010 06:26 PM, Lawrence D'Oliveiro wrote: >>> I'm not sure you understood me correctly, because I advocate >>> *not* doing input sanitization. Hard or not -- I don't want to know, >>> because I don't want to do it. >> >> But no-one has yet managed to

Re: Namespace problem?

2010-07-01 Thread Peter Pearson
On Thu, 01 Jul 2010 23:30:33 +0100, Rhodri James wrote: > On Thu, 01 Jul 2010 23:07:53 +0100, Josh English > wrote: > >> On Jul 1, 2:50 pm, Matt McCredie wrote: >>> >>> My guess is that the "if True" is actually something >>> else, and it isn't being interpreted as "True". As such, "fws_last_col

Re: Solutions for hand injury from computer use

2010-07-01 Thread Chris Rebert
On Thu, Jul 1, 2010 at 10:00 AM, Andreas Waldenburger wrote: > On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman > wrote: > >> I'll have to give the left-handed mouse a try... hmmm -- not too bad >> so far. > > Since we're on the subject: I find the best solution for "lots of > typing with a little

Re: automate minesweeper with python

2010-07-01 Thread Emile van Sebille
On 7/1/2010 2:52 PM Jay said... pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. ... or, you could always win... http://www.daniweb.com/forums/thread186209.html Emile PS -- in about '77

Re: Namespace problem?

2010-07-01 Thread Rhodri James
On Thu, 01 Jul 2010 23:07:53 +0100, Josh English wrote: On Jul 1, 2:50 pm, Matt McCredie wrote: My guess is that the "if True" is actually something else, and it isn't being interpreted as "True". As such, "fws_last_col" never gets assigned, and thus never gets created. You can fix that

Re: Python v3.1.2 documentation question

2010-07-01 Thread Ethan Furman
Aahz wrote: In article , Ethan Furman wrote: Stephen Hansen wrote: On 6/29/10 10:01 AM, Ethan Furman wrote: In the glossary section it states: nested scope The ability to refer to a variable in an enclosing definition. For instance, a function defined inside another function can refer to

Re: Namespace problem?

2010-07-01 Thread Mark Lawrence
On 01/07/2010 22:30, Josh English wrote: I have a script that generates a report from a bunch of data I've been collecting for the past year. I ran the script, successfully, for several weeks on test runs and creating more detailed reports. Today (back from vacation) and the script doesn't work.

Re: Namespace problem?

2010-07-01 Thread Josh English
On Jul 1, 2:50 pm, Matt McCredie wrote: > > That doesn't give me enough information to help you with the issue. In general > you need to provide enough code to reproduce the failure, not some modified > version that doesn't fail. My guess is that the "if True" is actually > something > else, and

[ANN]: Emacs For Python 0.1, collection of emacs extensions for python development

2010-07-01 Thread Gabriele Lanaro
Emacs For Python 0.1 Emacs for python (epy) is a collection of emacs extensions for python development, yet ready and configured for you. It includes also tweaks to commonly used extension to provide extra functionality and fast bug correction. There are also sane configuration that helps you ge

Re: python ctypes to int main(int argc, char *argv[])

2010-07-01 Thread Christian Heimes
> my question is, therefore, how do i specify a ctypes wrapper around > the standard int main(int argc, char *argv[]) which i am (obviously) > going to move to a (new) c library? Maybe I missing something here but libraries don't have a main() function. The main() function is the entry point of a

Re: Python v3.1.2 documentation question

2010-07-01 Thread Aahz
In article , Ethan Furman wrote: >Stephen Hansen wrote: >> On 6/29/10 10:01 AM, Ethan Furman wrote: >>> In the glossary section it states: >>> >>> >>> nested scope >>> >>> The ability to refer to a variable in an enclosing definition. For >>> instance, a function defined inside another function

Re: Python/C++ timer intermittent bug

2010-07-01 Thread Paul
Thanks, Thomas. The answer to most of your questions is that I'm very new at this! I'm asking this on the forums you suggested. - Paul On Thu, 01 Jul 2010 19:23:53 +0200, Thomas Jollans wrote: >On 06/30/2010 09:28 PM, p...@mail.python.org wrote: >> I have a problem with threading using the Py

Re: automate minesweeper with python

2010-07-01 Thread Jay
pywinauto looks to be almost perfect. All I need now is to read the numbers uncovered when a minesweeper square is clicked on, or that I just hit a mine. On Jun 30, 6:51 pm, Paul McGuire wrote: > On Jun 30, 6:39 pm, Jay wrote: > > > I would like to create a python script that plays the Windows g

Re: Namespace problem?

2010-07-01 Thread Matt McCredie
Josh English gmail.com> writes: > > I have a script that generates a report from a bunch of data I've been > collecting for the past year. I ran the script, successfully, for > several weeks on test runs and creating more detailed reports. > > Today (back from vacation) and the script doesn't w

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Mithrandir
Thomas Jollans wrote in news:mailman.55.1277936519.1673.python-l...@python.org: > On 06/30/2010 10:55 PM, D'Arcy J.M. Cain wrote: >> in all it's glory. >> >> :0: Hir >> * ^List-Id:.*python-list.python.org >> * ^From:@gmail.com >> * ^Newsgroups: >> /dev/null > > * X-Complaints-To: groups-a

Namespace problem?

2010-07-01 Thread Josh English
I have a script that generates a report from a bunch of data I've been collecting for the past year. I ran the script, successfully, for several weeks on test runs and creating more detailed reports. Today (back from vacation) and the script doesn't work. It's giving me a name error. I'm running

Re: List-type attributes and name strings

2010-07-01 Thread egbert
On Thu, Jul 01, 2010 at 02:28:37PM +0200, Bruno Desthuilliers wrote: > Either I failed to understand you or you overlooked some other > problem in you code and jumped to the wrong conclusions. > In my problem the the name of the list or dict to mutate arrives in namestring, so I could not use th

Packaging question

2010-07-01 Thread snorble
My question is, why do the modules bar and foo show up in mypack's dir()? I intend for Foo (the class foo.Foo) and Bar (the class bar.Bar) to be there, but was not sure about the modules foo and bar. My big picture intention is to create smaller modules, but more of them (like I am used to doing w

Re: python ctypes to int main(int argc, char *argv[])

2010-07-01 Thread Stefan Behnel
lkcl, 01.07.2010 22:22: i need to convert an application (fontforge) to a python library. yes, libfontforge is already done as is libgdraw (fontforge-pygtk) but i need to make fontforge the _application_ a python application, using the same ctypes trick that's already done. my question is, there

python ctypes to int main(int argc, char *argv[])

2010-07-01 Thread lkcl
hi, i need to convert an application (fontforge) to a python library. yes, libfontforge is already done as is libgdraw (fontforge-pygtk) but i need to make fontforge the _application_ a python application, using the same ctypes trick that's already done. my question is, therefore, how do i specif

Re: escape character / csv module

2010-07-01 Thread MRAB
V N wrote: string "\x00" has a length of 1. When I use the csv module to write that to a file csv_f = csv.writer(file("test.csv","wb"),delimiter="|") csv_f.writerow(["\x00","zz"]) The output file looks like this: |zz Is it possible to force the writer to write that string? It can write "\x0

Re: Solutions for hand injury from computer use

2010-07-01 Thread Cameron Simpson
On 01Jul2010 19:00, Andreas Waldenburger wrote: | On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman | wrote: | > I'll have to give the left-handed mouse a try... hmmm -- not too bad | > so far. | | Since we're on the subject: I find the best solution for "lots of | typing with a little mousing" to

Re: escape character / csv module

2010-07-01 Thread anon
V N wrote: string "\x00" has a length of 1. When I use the csv module to write that to a file csv_f = csv.writer(file("test.csv","wb"),delimiter="|") csv_f.writerow(["\x00","zz"]) The output file looks like this: |zz Is it possible to force the writer to write that string? This will do what

Anyone using GPG or PGP encryption/signatures in your Python apps?

2010-07-01 Thread python
Curious if any of you are using GPG or PGP encryption and/or signatures in your Python apps? In particular are you: 1. clearsigning specific emails? 2. validating clearsigned emails from others? 3. encrypting/decrypting files? 4. generating signatures for files that you are exchanging/posting for

Re: Solutions for hand injury from computer use

2010-07-01 Thread Aahz
In article <20100701190033.15cea...@geekmail.invalid>, Andreas Waldenburger wrote: > >Since we're on the subject: I find the best solution for "lots of >typing with a little mousing" to be a keyboard with a pointing stick >(or track point or nav stick or whatever people call it). I'm not quite >s

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Dotan Cohen
On 1 July 2010 00:06, Stephen Hansen wrote: > Gmail and Google Groups are not one and the same. There's a number of people > who subscribe to the list directly, use Gmail, and don't go anywhere near > Google Groups. > I'm one of them. Gmail is great for mailing lists, though I would never use it

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Thomas Jollans
On 07/01/2010 08:20 PM, Stephen Hansen wrote: > On 7/1/10 11:05 AM, Mithrandir wrote: > >> Just thought of this last night: If you view the full header you can see >> this: >> >> Complaints-To: groups-ab...@google.com >> >> Try blocking posts with that in the header. :) > > Better idea: auto-forw

Re: OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-01 Thread Thomas Jollans
On 07/01/2010 06:39 PM, John Doe wrote: > Is there a way to increase the line selection gutter width? It > seems to be only one pixel wide. In other words... When I single > click on the left side of the line, in order to automatically > select the line, the pointer must be in a precise single pixe

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Stephen Hansen
On 7/1/10 11:05 AM, Mithrandir wrote: Just thought of this last night: If you view the full header you can see this: Complaints-To: groups-ab...@google.com Try blocking posts with that in the header. :) Better idea: auto-forward any messages with that header, to that address. Odds are it's

Re: OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-01 Thread Ian Kelly
On Thu, Jul 1, 2010 at 10:39 AM, John Doe wrote: > Is there a way to increase the line selection gutter width? It > seems to be only one pixel wide. In other words... When I single > click on the left side of the line, in order to automatically > select the line, the pointer must be in a precise s

Re: Solutions for hand injury from computer use

2010-07-01 Thread Emile van Sebille
On 7/1/2010 10:46 AM Brian Victor said... Emile van Sebille wrote: When I started having trouble about ten years ago, I switched to a keyboard with integrated mouse pad. No problems since... Where did you find that? I've been looking for one. (Assuming you mean a trackpad, and not a mouse p

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Mithrandir
Bruno Desthuilliers wrote in news:4c2c9002$0$17075$426a3...@news.free.fr: > D'Arcy J.M. Cain a écrit : >> On Thu, 01 Jul 2010 14:07:27 +0200 >> Bruno Desthuilliers >> wrote: >>> And AFAICT you're wrong. I read and post to c.l.py using my >>> newsreader (so NOT going thru GG), and my personal a

Re: Python dynamic attribute creation

2010-07-01 Thread Rami Chowdhury
On 2010-07-01 23:42, WANG Cong wrote: > On 07/01/10 22:53, Stephen Hansen wrote: > > > > > One uses assignment syntax when the name of the attribute they are > > setting is known at the time when one writes the code. > > > > One uses the setattr function when the name of the attribute is not > >

Re: Solutions for hand injury from computer use

2010-07-01 Thread Brian Victor
Emile van Sebille wrote: > When I started having trouble about ten years ago, I switched to a > keyboard with integrated mouse pad. No problems since... Where did you find that? I've been looking for one. (Assuming you mean a trackpad, and not a mouse pad.) That said, my own solution was the

Re: Extract doc strings

2010-07-01 Thread moerchendiser2k3
Great! Thanks a lot! This is what I was looking for. :) Bye, moerchendiser2k3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4.2 Installation error

2010-07-01 Thread Albert Hopkins
On Thu, 2010-07-01 at 21:51 +0530, Dhilip S wrote: > Hello Everyone.. > > I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 > got error message while doing make command. anybody can tell tell, How > to overcome this error "this" error apparently did not get included in you

Re: Python/C++ timer intermittent bug

2010-07-01 Thread Thomas Jollans
On 06/30/2010 09:28 PM, p...@mail.python.org wrote: > I have a problem with threading using the Python/C API. I have an > extension that implements a timer, and the C++ timer callback function > calls a Python function. The relevant code looks like this: > > [snip] > > static void CALLBACK

Re: Solutions for hand injury from computer use

2010-07-01 Thread Andreas Waldenburger
On Thu, 01 Jul 2010 10:09:30 -0700 Emile van Sebille wrote: > On 7/1/2010 10:00 AM Andreas Waldenburger said... > > On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman > > wrote: > > > >> I'll have to give the left-handed mouse a try... hmmm -- not too > >> bad so far. > > > > Since we're on the subj

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

2010-07-01 Thread John Nagle
On 7/1/2010 8:36 AM, Mel wrote: Nobody wrote: On Wed, 30 Jun 2010 23:40:06 -0600, Michael Torrie wrote: Given "char buf[512]", buf's type is char * according to the compiler and every C textbook I know of. References from Kernighan& Ritchie _The C Programming Language_ second edition: No,

Re: Python 2.4.2 Installation error

2010-07-01 Thread Christian Heimes
> I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got > error message while doing make command. anybody can tell tell, How to > overcome this error Perhaps somebody is able to help you if you provide the full error message and describe all steps that lead to the error mesa

escape character / csv module

2010-07-01 Thread V N
string "\x00" has a length of 1. When I use the csv module to write that to a file csv_f = csv.writer(file("test.csv","wb"),delimiter="|") csv_f.writerow(["\x00","zz"]) The output file looks like this: |zz Is it possible to force the writer to write that string? -- http://mail.python.org/mailm

Re: Python 2.4.2 Installation error

2010-07-01 Thread Thomas Jollans
On 07/01/2010 06:21 PM, Dhilip S wrote: > Hello Everyone.. > > I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got > error message while doing make command. anybody can tell tell, How to > overcome this error Which error? > -- > with regards, > Dhilip.S > > -- h

Re: Solutions for hand injury from computer use

2010-07-01 Thread Emile van Sebille
On 7/1/2010 10:00 AM Andreas Waldenburger said... On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman wrote: I'll have to give the left-handed mouse a try... hmmm -- not too bad so far. Since we're on the subject: I find the best solution for "lots of typing with a little mousing" to be a keyboar

Re: Solutions for hand injury from computer use

2010-07-01 Thread Andreas Waldenburger
On Thu, 01 Jul 2010 09:35:31 -0700 Ethan Furman wrote: > I'll have to give the left-handed mouse a try... hmmm -- not too bad > so far. Since we're on the subject: I find the best solution for "lots of typing with a little mousing" to be a keyboard with a pointing stick (or track point or nav st

Re: Python dynamic attribute creation

2010-07-01 Thread Stephen Hansen
On 7/1/10 8:46 AM, WANG Cong wrote: However, I think setattr() is a builtin function, using it exposes the *magic* of metaprogramming (or class-programming, if more correct) at a first glance. I'm going to try this one more time -- you place a great deal of importance and special properties on

OT Komodo Edit, line selection gutter is one pixel wide?

2010-07-01 Thread John Doe
Is there a way to increase the line selection gutter width? It seems to be only one pixel wide. In other words... When I single click on the left side of the line, in order to automatically select the line, the pointer must be in a precise single pixel location immediately to the left of the line.

Re: Solutions for hand injury from computer use

2010-07-01 Thread Ethan Furman
Ben Finney wrote: geremy condra writes: Right. I'm much more concerned about the position of my Ctrl key, to avoid hand injury from all the key chording done as a programmer. Not saying its a cure-all, but I broke my hand pretty badly a few years ago and had a lot of luck with a homemade foot

Python 2.4.2 Installation error

2010-07-01 Thread Dhilip S
Hello Everyone.. I'm using Ubuntu 10.04, i try to install Python 2.4.2 & Python 2.4.3 got error message while doing make command. anybody can tell tell, How to overcome this error -- with regards, Dhilip.S -- http://mail.python.org/mailman/listinfo/python-list

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

2010-07-01 Thread Michael Torrie
On 07/01/2010 01:24 AM, Nobody wrote: > No, the type of "buf" is "char [512]", i.e. "array of 512 chars". If you > use "buf" as an rvalue (rather than an lvalue), it will be implicitly > converted to char*. Yes this is true. I misstated. I meant that most text books I've seen say to just use the

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 07/01/10 23:19, Stephen Hansen wrote: >> >> As long as setattr() exists in Python, that will be not so ordinary. :) > > setattr is perfectly ordinary. If you think setattr() is as ordinary as a trivial assignment, I will argue with you, this is personal taste. However, I think setattr() is a

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

2010-07-01 Thread Mel
Nobody wrote: > On Wed, 30 Jun 2010 23:40:06 -0600, Michael Torrie wrote: >> Given "char buf[512]", buf's type is char * according to the compiler >> and every C textbook I know of. References from Kernighan & Ritchie _The C Programming Language_ second edition: > No, the type of "buf" is "char

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 07/01/10 22:53, Stephen Hansen wrote: > > One uses assignment syntax when the name of the attribute they are > setting is known at the time when one writes the code. > > One uses the setattr function when the name of the attribute is not > known until runtime. > > The difference has *nothing a

Re: Composition of functions

2010-07-01 Thread MRAB
Zubin Mithra wrote: Er, I don't think you thought that one entirely through (/ tried it out): My Apologies. Here is a working one. >>> x="123" >>> t = list(x) >>> t.reverse() >>> print ''.join(t) 321 But of course, the method which was suggested earlier is far more elegant. >

Re: Python dynamic attribute creation

2010-07-01 Thread Stephen Hansen
On 7/1/10 8:02 AM, WANG Cong wrote: On 06/27/10 09:06, Steven D'Aprano wrote: In that situation, certainly: adding an attribute on the fly to that formal definition seems entirely strange and special of an activity. But that's only because you *chose* to *see* and *use* the object that way. Th

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 06/28/10 17:43, Bruno Desthuilliers wrote: > Carl Banks a écrit : >> 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

Sphinx-1.0b compilation for python3.1

2010-07-01 Thread Richard Mathar
I am trying to install Sphinx-1.0b under a Python3 environment. Does anyone have experience with that task? cd *1.0b2 python3 setup.py build File "setup.py", line 50 print 'ERROR: Sphinx requires at least Python 2.4 to run.' So ../ 2to3 -w Sphinx-1.0b2 ... RefactoringTool: Warnings/mes

Re: Python dynamic attribute creation

2010-07-01 Thread Stephen Hansen
On 7/1/10 7:44 AM, WANG Cong wrote: On 07/01/10 13:49, Stephen Hansen wrote: It may not be "the" primary concern, but elegance certainly is *a* primary concern. I concur. Its not explicitly stated, but it is the Zen 0. This is further supported by its implied presence in many of the Axioms a

Re: I strongly dislike Python 3

2010-07-01 Thread Aahz
In article , geremy condra wrote: >On Wed, Jun 30, 2010 at 4:34 PM, Steven D'Aprano > wrote: >> On Wed, 30 Jun 2010 22:52:06 +1000, Lie Ryan wrote: >>> >>> That is precisely how the quick-and-dirty syntax of print statement can >>> be justified. While debugging, you'll need to be able to quickly

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 06/27/10 09:06, Steven D'Aprano wrote: >> In that situation, certainly: adding an attribute on the fly to that >> formal definition seems entirely strange and special of an activity. But >> that's only because you *chose* to *see* and *use* the object that way. >> The "special"ness of the acti

Re: Python dynamic attribute creation

2010-07-01 Thread Aahz
In article , WANG Cong wrote: >On 07/01/10 13:49, Stephen Hansen wrote: >>Wang Cong deleted the attribution for Aahz: >>> >>> It may not be "the" primary concern, but elegance certainly is *a* >>> primary concern. >> >> I concur. >> >> Its not explicitly stated, but it is the Zen 0. This is furt

Re: Python dynamic attribute creation

2010-07-01 Thread Aahz
In article , Michael Torrie wrote: >On 06/28/2010 02:31 PM, Aahz wrote: >> In article , >> Michael Torrie wrote: >>> >>> True. But you can't really criticize a language's implementation of OOP >>> without a good understanding of the "pure" OO language. For example, in >>> Smalltalk If/Then st

Re: Python dynamic attribute creation

2010-07-01 Thread Stephen Hansen
On 7/1/10 7:31 AM, WANG Cong wrote: On 06/30/10 01:20, Stephen Hansen wrote: But if so why setattr() still exists? What is it for if we can do the same thing via assignments? Also, in order to be perfect, Python should accept to add dynamic attributes dynamically, something like PEP 363. That

Re: I strongly dislike Python 3

2010-07-01 Thread Ricardo Aráoz
On 30/06/2010 01:23 p.m., Lie Ryan wrote: On 07/01/10 01:42, Michele Simionato wrote: On Jun 30, 2:52 pm, Lie Ryan wrote: On 06/27/10 11:24, Steven D'Aprano wrote: Producing print function takes a little bit more effort than producing a print statement. (1) The main use-cases for prin

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 07/01/10 13:49, Stephen Hansen wrote: Hi, Stephen, >> >> It may not be "the" primary concern, but elegance certainly is *a* >> primary concern. > > I concur. > > Its not explicitly stated, but it is the Zen 0. This is further > supported by its implied presence in many of the Axioms and Truth

Re: Python dynamic attribute creation

2010-07-01 Thread Stephen Hansen
On 7/1/10 5:41 AM, Bruno Desthuilliers wrote: Stephen Hansen a écrit : On 6/30/10 10:37 PM, Aahz wrote: It may not be "the" primary concern, but elegance certainly is *a* primary concern. I concur. Its not explicitly stated, but it is the Zen 0. This is further supported by its implied prese

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 06/30/10 01:20, Stephen Hansen wrote: >> But if so why setattr() still exists? What is it for if we can do the >> same thing via assignments? Also, in order to be perfect, Python should >> accept to add dynamic attributes dynamically, something like PEP >> 363. That doesn't happen. > > What do

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Stephen Hansen
On 7/1/10 5:11 AM, Roy Smith wrote: Stephen Hansen wrote: The quote does not deny the power of regular expressions; it challenges widely held assumption and belief that comes from *somewhere* that they are the best way to approach any problem that is text related. Well, that assumption comes

Re: Why are String Formatted Queries Considered So Magical?

2010-07-01 Thread Stephen Hansen
On 7/1/10 3:03 AM, Jean-Michel Pichavant wrote: Re is part of the python standard library, for some purpose I guess. No, *really*? So all those people who have been advocating its useless and shouldn't be are already too late? Damn. Well, there goes *that* whole crusade we were all out on.

Re: Composition of functions

2010-07-01 Thread Stephen Hansen
On 7/1/10 5:29 AM, Wolfram Hinderer wrote: On 1 Jul., 06:04, Stephen Hansen wrote: The 'reversed' and 'sorted' functions are generators that lazilly convert an iterable as needed. 'sorted' returns a new list (and is not lazy). Oops, you're right. Got the two crossed into one in my head. --

Re: Python dynamic attribute creation

2010-07-01 Thread WANG Cong
On 06/30/10 01:25, Ethan Furman wrote: >> But if so why setattr() still exists? What is it for if we can do the >> same thing via assignments? Also, in order to be perfect, Python should >> accept to add dynamic attributes dynamically, something like PEP >> 363. That doesn't happen. > > Setattr a

Re: I strongly dislike Python 3

2010-07-01 Thread Lou Pecora
In article <3f35dcf5-25ff-4aa7-820c-592cbffa4...@u26g2000yqu.googlegroups.com>, rantingrick wrote: > On Jun 30, 4:21 pm, geremy condra wrote: > > > Actually, I agree with this complaint though- it is much easier to type > > spaces than parens. > > Oh Geremy please. If you're going to whine a

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

2010-07-01 Thread Bill Davy
"Stephen Hansen" wrote in message news:mailman.2344.1277821469.32709.python-l...@python.org... > On 6/29/10 12:27 AM, Lawrence D'Oliveiro wrote: >> In message<4c286d71$0$18654$4fafb...@reader3.news.tin.it>, superpollo >> wrote: >> >>> Lawrence D'Oliveiro ha scritto: Is it really such a

Re: stupid question about html page

2010-07-01 Thread drygal
On 1 July, 09:31, luca72 wrote: > On 1 Lug, 10:16, Mithrandir > wrote: > > > > > > > luca72 wrote in news:abfb7720-6132-4b7b-8084- > > 5c1a48164...@y11g2000yqm.googlegroups.com: > > > > hello > > > with webbrowser i open the html or php etc page, how i can save the > > > opened page with python?

Re: Ignorance and Google Groups (again)

2010-07-01 Thread Bruno Desthuilliers
D'Arcy J.M. Cain a écrit : On Thu, 01 Jul 2010 14:07:27 +0200 Bruno Desthuilliers wrote: And AFAICT you're wrong. I read and post to c.l.py using my newsreader (so NOT going thru GG), and my personal address is @gmail.com. But... From: Bruno Desthuilliers Sorry, there's a missing "some

Re: Python dynamic attribute creation

2010-07-01 Thread Bruno Desthuilliers
Stephen Hansen a écrit : On 6/30/10 10:37 PM, Aahz wrote: In article<4c29ad38$0$26210$426a7...@news.free.fr>, Bruno Desthuilliers wrote: Aahz a écrit : In article<4c285e7c$0$17371$426a7...@news.free.fr>, Bruno Desthuilliers wrote: Aahz a écrit : In article<4c2747c1$0$4545$426a7...@news.fre

Re: Ignorance and Google Groups (again)

2010-07-01 Thread D'Arcy J.M. Cain
On Thu, 01 Jul 2010 14:07:27 +0200 Bruno Desthuilliers wrote: > And AFAICT you're wrong. I read and post to c.l.py using my newsreader > (so NOT going thru GG), and my personal address is @gmail.com. But... > From: Bruno Desthuilliers -- D'Arcy J.M. Cain | Democracy is three wolves

Re: Composition of functions

2010-07-01 Thread Wolfram Hinderer
On 1 Jul., 06:04, Stephen Hansen wrote: > The 'reversed' and 'sorted' functions are generators that lazilly > convert an iterable as needed. 'sorted' returns a new list (and is not lazy). -- http://mail.python.org/mailman/listinfo/python-list

Re: List-type attributes and name strings

2010-07-01 Thread Bruno Desthuilliers
egbert a écrit : Normally you use setattr() if the name of the attribute is in a namestring: setattr(self, namestring, value) But my attributes are lists or dictionaries, and I don't seem to be able to use setattr anymore. Python 2.6.2 (release26-maint, Apr 19 2009, 01:56:41) [GCC 4.3.3] on

  1   2   >