Re: Aggressive language on python-list

2012-10-13 Thread Dwight Hutto
I'm not a know it all, but when attacked personally I defend myself, and those can turn into flame wars. Your plonks are irrelevant in terms of an argument ytou shouldn't participate in. These things can get nasty quick. So if you have virgin eyes, then kill file it, but I like to think Ioffer l

Re: Understanding and dealing with an exception

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 4:01 PM, Vincent Davis wrote: > I can open it is and all looks good using Pixelmator (I don't have Photoshop > installed). I don't think there is anything wrong with the image. > > Part of my question is a result of being new to actually using exceptions in > my programs an

Re: trouble with nested closures: one of my variables is missing...

2012-10-13 Thread Chris Rebert
On Saturday, October 13, 2012, Cameron Simpson wrote: > I'm having some trouble with closures when defining a decorator. > However, I can't make my make_file_property function work. I've stripped > the code down and it does this: > Traceback (most recent call last): > File "foo.py", li

Re: Understanding and dealing with an exception

2012-10-13 Thread Vincent Davis
I can open it is and all looks good using Pixelmator (I don't have Photoshop installed). I don't think there is anything wrong with the image. Part of my question is a result of being new to actually using exceptions in my programs and dealing with the exceptions is a primary part of what I need t

Re: Understanding and dealing with an exception

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 3:36 PM, Vincent Davis wrote: > Oops, I was going to make note of the file size. 1.2MB Then I'd definitely declare the file bad; I don't know what the valid ranges for channels and ysize are, but my reading of that is that your file's completely corrupt, maybe even malicio

Re: Understanding and dealing with an exception

2012-10-13 Thread Vincent Davis
Oops, I was going to make note of the file size. 1.2MB Vincent On Sat, Oct 13, 2012 at 10:31 PM, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 3:23 PM, Vincent Davis > wrote: > > OverflowError: Python int too large to convert to C long > > line 266, in _maketile > > bytecount = read(chan

Re: Understanding and dealing with an exception

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 3:23 PM, Vincent Davis wrote: > OverflowError: Python int too large to convert to C long > line 266, in _maketile > bytecount = read(channels * ysize * 2) Is the file over 2GB? Might be a limitation, more than a bug, and one that could possibly be raised by using a 64-bi

Understanding and dealing with an exception

2012-10-13 Thread Vincent Davis
I am working on a script to find bad image files. I am using PIL and specifically image.verify() I have a set of known to be bad image files to test. I also what to be able to test any file for example a .txt and deal with the exception. Currently my code is basically try: im = Image.open(ifil

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 2:37 PM, Steven D'Aprano wrote: > On Sun, 14 Oct 2012 05:33:40 +1100, Chris Angelico wrote: > >> Forcing programmers to work in one particular style is usually not the >> job of the language/framework/library. > > Have you actually programmed before? > > *grin* > > I've nev

trouble with nested closures: one of my variables is missing...

2012-10-13 Thread Cameron Simpson
I'm having some trouble with closures when defining a decorator. TL;DR: I have a function that makes a decorator, and only some of the names from an outer scope appear in the inner closure's locals(). And I do not understand why at all. Let me explain... Environment: python 2.7.3 on MacOSX

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Steven D'Aprano
On Sun, 14 Oct 2012 05:33:40 +1100, Chris Angelico wrote: > Forcing programmers to work in one particular style is usually not the > job of the language/framework/library. Have you actually programmed before? *grin* I've never come across a language/framework/library that DOESN'T force progra

Re: Feedback on my python framework I'm building.

2012-10-13 Thread MRAB
On 2012-10-14 03:25, Steven D'Aprano wrote: On Sat, 13 Oct 2012 15:24:04 -0700, nbvfour wrote: On Saturday, October 13, 2012 2:33:43 PM UTC-4, Chris Angelico wrote: Nice theory, but this is the bit that I fundamentally disagree with. Forcing programmers to work in one particular style is usua

Re: one obvious parser (was "Feedback on my python framework I'm building.")

2012-10-13 Thread Tim Chase
On 10/13/12 21:25, Steven D'Aprano wrote: > Not being Dutch, I don't know whether the obvious way to do command line > argument handling is the getopt module or argparse. But there certainly > isn't *only one way* to do command line argument handling. As an aside, I just watched a fascinating vi

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Steven D'Aprano
On Sat, 13 Oct 2012 15:24:04 -0700, nbvfour wrote: > On Saturday, October 13, 2012 2:33:43 PM UTC-4, Chris Angelico wrote: >> >> Nice theory, but this is the bit that I fundamentally disagree with. >> Forcing programmers to work in one particular style is usually not the >> job of the language/fr

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Oscar Benjamin
On 13 October 2012 17:48, Chris Angelico wrote: > > The only way to support *absolutely everything* is to do nothing - to > be a framework so thin you're invisible. (That's not to say you're > useless; there are bridge modules that do exactly this - ctypes can > call on any library function from P

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
On 13/10/2012 23:52, Mark Lawrence wrote: On 13/10/2012 23:26, Joshua Landau wrote: On 13 October 2012 23:13, Mark Lawrence wrote: On 13/10/2012 22:31, Joshua Landau wrote: With two irritants (including 8), is it not advisable that python-list gets an admin to block these accounts? Eve

Re: Aggressive language on python-list

2012-10-13 Thread Tim Delaney
> > A response to someone who quotes a trollbot just stating "*Username* is a > trollbot." where *no* further correspondence occurs doesn't seem like > trollbotbait to me, and it makes it easy for people to know who's been > warned. > If properly trimmed, so there is no reference to the troll/bot

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 9:24 AM, wrote: > On Saturday, October 13, 2012 2:33:43 PM UTC-4, Chris Angelico wrote: >> >> Nice theory, but this is the bit that I fundamentally disagree with. >> Forcing programmers to work in one particular style is usually not the >> job of the language/framework/lib

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
On 13/10/2012 23:26, Joshua Landau wrote: On 13 October 2012 23:13, Mark Lawrence wrote: On 13/10/2012 22:31, Joshua Landau wrote: With two irritants (including 8), is it not advisable that python-list gets an admin to block these accounts? Even if it does nothing more than slow them, t

Re: readline trick needed

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 9:25 AM, Joshua Landau wrote: > On 13 October 2012 22:44, Chris Angelico wrote: >> >> On Sun, Oct 14, 2012 at 8:31 AM, Joshua Landau >> wrote: >> > With two irritants (including 8), is it not advisable that >> > python-list >> > gets an admin to block these accounts?

Re: readline trick needed

2012-10-13 Thread Joshua Landau
On 13 October 2012 23:13, Mark Lawrence wrote: > On 13/10/2012 22:31, Joshua Landau wrote: > >> >> With two irritants (including 8), is it not advisable that python-list >> gets an admin to block these accounts? Even if it does nothing more than >> slow them, that's something. >> >> > Most ir

Re: readline trick needed

2012-10-13 Thread Joshua Landau
On 13 October 2012 22:44, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 8:31 AM, Joshua Landau > wrote: > > With two irritants (including 8), is it not advisable that > python-list > > gets an admin to block these accounts? Even if it does nothing more than > > slow them, that's something.

Re: Feedback on my python framework I'm building.

2012-10-13 Thread nbvfour
On Saturday, October 13, 2012 2:33:43 PM UTC-4, Chris Angelico wrote: > > Nice theory, but this is the bit that I fundamentally disagree with. > Forcing programmers to work in one particular style is usually not the > job of the language/framework/library. That should be up to the > programmer, or

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Joshua Landau
On 13 October 2012 23:09, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 9:00 AM, Joshua Landau > wrote: > > That is also callable from the command-line like so: > >> > >> python -m debrace -c "if a: ${ print(1) $ print(2) $ while b: c() $ if > g: > >> ${ pass }$ }$ print(d)" > > Wait you'r

Re: readline trick needed

2012-10-13 Thread Mark Lawrence
On 13/10/2012 22:31, Joshua Landau wrote: With two irritants (including 8), is it not advisable that python-list gets an admin to block these accounts? Even if it does nothing more than slow them, that's something. Most irritants are mere amateurs compared to Ilias Lazaridis. I wonder i

Re: Aggressive language on python-list

2012-10-13 Thread Joshua Landau
On 13 October 2012 22:35, Tim Delaney wrote: > On 14 October 2012 08:22, Roel Schroeven wrote: > >> Zero Piraeus schreef: >> >> : >>> >>> Not sure exactly how to put this ... >>> >>> I'm a mostly passive subscriber to this list - my posts here over the >>> years could probably be counted withou

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 9:00 AM, Joshua Landau wrote: > That is also callable from the command-line like so: >> >> python -m debrace -c "if a: ${ print(1) $ print(2) $ while b: c() $ if g: >> ${ pass }$ }$ print(d)" Wait you're pretty much implementing from __future__ import braces? ChrisA -

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Joshua Landau
On 13 October 2012 22:39, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 6:06 AM, Joshua Landau > wrote: > > The fact that your proposal can't allow "a=[]\nfor x in range(10): > > a.append(x**a[-2])\nprint(a)" makes it somewhat an incomplete suggestion, > > and code like: > > > >> while True: w

Re: readline trick needed

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 8:31 AM, Joshua Landau wrote: > With two irritants (including 8), is it not advisable that python-list > gets an admin to block these accounts? Even if it does nothing more than > slow them, that's something. That's what killfiles are for. You have two options: http:/

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 6:06 AM, Joshua Landau wrote: > The fact that your proposal can't allow "a=[]\nfor x in range(10): > a.append(x**a[-2])\nprint(a)" makes it somewhat an incomplete suggestion, > and code like: > >> while True: while True: break; break > > is just confusing. Agreed. However,

Re: Aggressive language on python-list

2012-10-13 Thread Tim Delaney
On 14 October 2012 08:22, Roel Schroeven wrote: > Zero Piraeus schreef: > > : >> >> Not sure exactly how to put this ... >> >> I'm a mostly passive subscriber to this list - my posts here over the >> years could probably be counted without having to take my socks off - >> so perhaps I have no ri

Re: readline trick needed

2012-10-13 Thread Joshua Landau
On 13 October 2012 22:14, Roel Schroeven wrote: > Etienne Robillard schreef: > > On Sun, 14 Oct 2012 00:47:52 +1100 >> Chris Angelico wrote: >> >> Excuse me? >>> >>> I'm not overly familiar with readline, so perhaps there is a really >>> obvious way to do what Steven's trying to do, but this p

Re: Aggressive language on python-list

2012-10-13 Thread Roel Schroeven
Zero Piraeus schreef: : Not sure exactly how to put this ... I'm a mostly passive subscriber to this list - my posts here over the years could probably be counted without having to take my socks off - so perhaps I have no right to comment, but I've noticed a marked increase in aggressive langua

Re: readline trick needed

2012-10-13 Thread Roel Schroeven
Etienne Robillard schreef: On Sun, 14 Oct 2012 00:47:52 +1100 Chris Angelico wrote: Excuse me? I'm not overly familiar with readline, so perhaps there is a really obvious way to do what Steven's trying to do, but this post does not appear to be the result of a lack of thinking. If it really

Re: Is `wsample` a proper name for a function like this?

2012-10-13 Thread Joshua Landau
On 12 October 2012 03:22, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > On Wed, 10 Oct 2012 23:44:42 -0700, suzaku wrote: > > > I think if a programmer has used the built-in `random` module before, he > > would expect a function with "sample" in its name to return a population >

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Joshua Landau
On 13 October 2012 19:41, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 5:21 AM, Joshua Landau > wrote: > > Because Python uses indentation, what would "if A: print(1); if B: > print(2)" > > even do? It has to fail, because we have to assume consistent indentation > > for ";"s*. With "\n" as I

Re: Understanding http proxies

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 5:43 AM, Olive wrote: > it seems when I read the code above that the proxy acts mostly as an > orinary server with respect to the client except that it is supposed to > receive the full URL instead of just the path. Am I right? Is there any > documentation on what an http p

Understanding http proxies

2012-10-13 Thread Olive
I am trying to understand how to build an http proxy server in python, and I have found the following example: http://www.oki-osk.jp/esc/python/proxy/ But I do not have found an exact description of what exactly a proxy server is suppose to do (all references gice only the basic principe of proxy

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 5:21 AM, Joshua Landau wrote: > Because Python uses indentation, what would "if A: print(1); if B: print(2)" > even do? It has to fail, because we have to assume consistent indentation > for ";"s*. With "\n" as I proposed, you still have to indent: it is just a > method to

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 5:18 AM, wrote: > On Saturday, October 13, 2012 12:48:23 PM UTC-4, Chris Angelico wrote: >> No, I don't, because I haven't tried to use it. But allow me to give >> two examples, one on each side of the argument. >> >> The 'tee' utility is primarily for writing a pipe to di

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Joshua Landau
On 13 October 2012 18:23, Chris Angelico wrote: > On Sun, Oct 14, 2012 at 3:38 AM, Joshua Landau > wrote: > > This here isn't a flaw in Python, though. It's a flaw in the command-line > > interpreter. By putting it all on one line, you are effectively saying: > > "group these". Which is the same

Re: Feedback on my python framework I'm building.

2012-10-13 Thread nbvfour
On Saturday, October 13, 2012 12:48:23 PM UTC-4, Chris Angelico wrote: > No, I don't, because I haven't tried to use it. But allow me to give > two examples, one on each side of the argument. > > The 'tee' utility is primarily for writing a pipe to disk AND to > further pipelining, for instance:

Re: Where are documentation for Gnome

2012-10-13 Thread Kwpolska
On Sat, Oct 13, 2012 at 7:50 PM, Santosh Kumar wrote: > Where are the documentation for Gnome's EOG? I want to develop a > plugin in Python. > > On 10/13/12, Santosh Kumar wrote: >> >> > -- > http://mail.python.org/mailman/listinfo/python-list https://live.gnome.org/EyeOfGnome/Plugins#Python Th

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 4:43 AM, Jussi Piitulainen wrote: > Chris Angelico writes: > >> Here's a side challenge. In any shell you like, start with this >> failing statement, and then fix it without retyping anything: >> >> sikorsky@sikorsky:~$ python -c "a=1; if a: print(a)" > > C-v C-j inserts a

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Jussi Piitulainen
Chris Angelico writes: > Here's a side challenge. In any shell you like, start with this > failing statement, and then fix it without retyping anything: > > sikorsky@sikorsky:~$ python -c "a=1; if a: print(a)" > File "", line 1 > a=1; if a: print(a) > ^ > SyntaxError: invalid synt

Re: Aggressive language on python-list

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 2:21 AM, Zero Piraeus wrote: > I'm a mostly passive subscriber to this list - my posts here over the > years could probably be counted without having to take my socks off - > so perhaps I have no right to comment, but I've noticed a marked > increase in aggressive language

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 3:38 AM, Joshua Landau wrote: > This here isn't a flaw in Python, though. It's a flaw in the command-line > interpreter. By putting it all on one line, you are effectively saying: > "group these". Which is the same as an "if True:" block, and some things > like Reinteract e

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 2:57 AM, wrote: > Do you have an example of a task that giotto can't handle that other > frameworks can? One of my goals is to have this framework "turing complete" > in the sense that everything that other frameworks can do, giotto should be > able to do. I think my co

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Joshua Landau
On 13 October 2012 10:03, Chris Angelico wrote: > On Sat, Oct 13, 2012 at 7:41 PM, Thomas Bach > wrote: > > On Sat, Oct 13, 2012 at 12:32:41AM +, Steven D'Aprano wrote: > >> > >> He gets SyntaxError because you can't follow a semicolon with a > >> statement that begins a block. > > > > Can

Re: Aggressive language on python-list

2012-10-13 Thread Joshua Landau
On 13 October 2012 16:21, Zero Piraeus wrote: > : > > Not sure exactly how to put this ... > > I'm a mostly passive subscriber to this list - my posts here over the > years could probably be counted without having to take my socks off - > so perhaps I have no right to comment, but I've noticed a

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Etienne Robillard
On Sat, 13 Oct 2012 08:57:47 -0700 (PDT) nbvf...@gmail.com wrote: > Do you have an example of a task that giotto can't handle that other > frameworks can? One of my goals is to have this framework "turing complete" > in the sense that everything that other frameworks can do, giotto should be >

Re: Feedback on my python framework I'm building.

2012-10-13 Thread nbvfour
On Saturday, October 13, 2012 10:13:22 AM UTC-4, Chris Angelico wrote: > On Sat, Oct 13, 2012 at 3:49 PM, wrote: > > > Basically its a framework that forces the developer(s) to strictly separate > > the model from the view and controller. You can 'hook up' multiple > > controllers to a project

Re: Aggressive language on python-list

2012-10-13 Thread Etienne Robillard
On Sat, 13 Oct 2012 11:21:28 -0400 Zero Piraeus wrote: > : > > Not sure exactly how to put this ... > > I'm a mostly passive subscriber to this list - my posts here over the > years could probably be counted without having to take my socks off - > so perhaps I have no right to comment, but I've

Aggressive language on python-list

2012-10-13 Thread Zero Piraeus
: Not sure exactly how to put this ... I'm a mostly passive subscriber to this list - my posts here over the years could probably be counted without having to take my socks off - so perhaps I have no right to comment, but I've noticed a marked increase in aggressive language here lately, so I'm p

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Etienne Robillard
On Sun, 14 Oct 2012 01:12:30 +1100 Chris Angelico wrote: > On Sat, Oct 13, 2012 at 3:49 PM, wrote: > > Basically its a framework that forces the developer(s) to strictly separate > > the model from the view and controller. You can 'hook up' multiple > > controllers to a project. The model lay

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Chris Angelico
On Sat, Oct 13, 2012 at 3:49 PM, wrote: > Basically its a framework that forces the developer(s) to strictly separate > the model from the view and controller. You can 'hook up' multiple > controllers to a project. The model layer can be completely mocked out so > front end designers don't hav

Re: readline trick needed

2012-10-13 Thread Etienne Robillard
On Sun, 14 Oct 2012 00:47:52 +1100 Chris Angelico wrote: > Excuse me? > > I'm not overly familiar with readline, so perhaps there is a really > obvious way to do what Steven's trying to do, but this post does not > appear to be the result of a lack of thinking. > > If it really IS that obvious

Re: readline trick needed

2012-10-13 Thread Chris Angelico
On Sun, Oct 14, 2012 at 12:44 AM, Etienne Robillard wrote: > Why dont you grow yourself some usable neurons instead ? Don't you realize > now stackoverflow.com is starting > to hurt your capacity to cogitate on your own or have you not realized this > yet? Excuse me? I'm not overly familiar wi

Re: Checking for dlls in ctypes

2012-10-13 Thread 88888 Dihedral
Wanderer於 2012年10月12日星期五UTC+8下午11時36分27秒寫道: > I'm trying to write some code that will load one of three dll depending on > the one available. I've tried the code below, but it doesn't work. The try > except doesn't catch the exception. Is there a way to do this? > > > > try: > >

Re: readline trick needed

2012-10-13 Thread Etienne Robillard
On 13 Oct 2012 13:30:14 GMT Steven D'Aprano wrote: > I'm working with the readline module, and I'm trying to set a key > combination to process the current command line by calling a known > function, *and* enter the command line. > > Something along the lines of: > > * execute function spam()

readline trick needed

2012-10-13 Thread Steven D'Aprano
I'm working with the readline module, and I'm trying to set a key combination to process the current command line by calling a known function, *and* enter the command line. Something along the lines of: * execute function spam() in some context where it can access the current command line as

Re: Checking for dlls in ctypes

2012-10-13 Thread Nobody
On Fri, 12 Oct 2012 12:28:17 -0400, Dave Angel wrote: > Using bare excepts is almost never a good idea. If it "works" you get no > clues what went wrong. For example, a typo in source code can trigger a > bare exception, as can a user typing Ctrl-C. So when you're using bare > excepts, you hav

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Chris Angelico
On Sat, Oct 13, 2012 at 7:41 PM, Thomas Bach wrote: > On Sat, Oct 13, 2012 at 12:32:41AM +, Steven D'Aprano wrote: >> >> He gets SyntaxError because you can't follow a semicolon with a >> statement that begins a block. > > Can someone provide a link on where to find this type of information?

Re: How to use "while" within the command in -c option of python?

2012-10-13 Thread Thomas Bach
On Sat, Oct 13, 2012 at 12:32:41AM +, Steven D'Aprano wrote: > > He gets SyntaxError because you can't follow a semicolon with a > statement that begins a block. Can someone provide a link on where to find this type of information? I was just hunting through “The Python Language Reference” a

Re: Feedback on my python framework I'm building.

2012-10-13 Thread Etienne Robillard
On Fri, 12 Oct 2012 21:49:55 -0700 (PDT) nbvf...@gmail.com wrote: > http://giotto.readthedocs.org/en/latest/tutorial.html > > Can someone give me some feedback on what they think of this framework? I > came up with the idea of this framework a few months ago. I gave a talk at a > local python u

The message was not delivered

2012-10-13 Thread noreply
The attached message was mark as SPAM. The message was not delivered.--- Begin Message --- Some parts of this message were removed because they violated your mail server's policies. message.zip was removed from the message because it violates your mail server's policy. --- Begin Message ---