output from popen

2010-04-05 Thread hiral
Hi, I am trying following script...

Re: output from popen

2010-04-05 Thread Kushal Kumaran
On Mon, Apr 5, 2010 at 1:33 PM, hiral wrote: > Hi, > I am trying following script... > >

Re: In disGuiodoise?

2010-04-05 Thread Martin P. Hellwig
On 04/05/10 00:05, r wrote: However i have also considered that maybe *all* the "well knowns" are in fact the many colorful personalities of Guido. De vraag is dan natuurlijk of al zijn persoonlijkheden nog steeds nederlands machtig zijn. -- mph -- http://mail.python.org/mailman/listinfo/

Translation docstrings with gettext

2010-04-05 Thread sapient
Hello. I found several discussions where this question was asked, but was not answered. Now I am creating Python-API for my application, and want create it with translation support, including documentation strings for modules, classes, methods etc. It is simple to translate special-marked string

pythonrag

2010-04-05 Thread Jason Friedman
I saw this posted in the July issue but did not see any follow-up there: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> a = 500 >>> b = 500 >>> a == b True >>> a is b False >>> p = 50 >>> q

Re: pythonrag

2010-04-05 Thread Xavier Ho
Python caches objects for reuse, but I'm not too certain on how it works, either. Seems a bit odd. I just tested on 2.6.5 and got the same result. This hasn't been a problem for me, though. Cheers, Xav -- http://mail.python.org/mailman/listinfo/python-list

Re: In disGuiodoise?

2010-04-05 Thread News123
Martin P. Hellwig wrote: > On 04/05/10 00:05, r wrote: > >> However i have also considered that maybe *all* the "well knowns" are >> in fact the many colorful personalities of Guido. >> > > > De vraag is dan natuurlijk of al zijn persoonlijkheden nog steeds > nederlands machtig zijn. > Good so

Re: pythonrag

2010-04-05 Thread superpollo
Jason Friedman ha scritto: I saw this posted in the July issue but did not see any follow-up there: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. a = 500 b = 500 a == b True a is b False

Re: pythonrag

2010-04-05 Thread Albert Hopkins
On Mon, 2010-04-05 at 11:38 +, Jason Friedman wrote: > I saw this posted in the July issue but did not see any follow-up there: > > $ python > Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) > [GCC 4.4.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>

Re: In disGuiodoise?

2010-04-05 Thread Andreas Waldenburger
On Mon, 05 Apr 2010 13:48:15 +0200 News123 wrote: > Martin P. Hellwig wrote: > > On 04/05/10 00:05, r wrote: > > > >> However i have also considered that maybe *all* the "well knowns" > >> are in fact the many colorful personalities of Guido. > >> > > > > > > De vraag is dan natuurlijk of al z

Re: pythonrag

2010-04-05 Thread Irmen de Jong
On 5-4-2010 13:48, superpollo wrote: Jason Friedman ha scritto: I saw this posted in the July issue but did not see any follow-up there: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. a = 500

Re: Translation docstrings with gettext

2010-04-05 Thread Lie Ryan
On 04/05/10 20:31, sapient wrote: > Hello. > > I found several discussions where this question was asked, but was not > answered. Why would you want to translate docstring? Docstring is meant for developers not users. Maintaining a translated docstring is going to be a maintenance hell and will e

Re: pythonrag

2010-04-05 Thread Gary Herron
Jason Friedman wrote: I saw this posted in the July issue but did not see any follow-up there: $ python Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. a = 500 b = 500 a == b True a is

Interfaces

2010-04-05 Thread Roald de Vries
Dear all, PEP 245 and 246 about interfaces for python are both rejected for 'something much better' (GvR in 246's rejection notice). Does anybody know what this is? I am *very* curious! Kind regards, Roald -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting Local MAC Address

2010-04-05 Thread Booter
All, Thanks for all of the great solutions! Sorry I wasn't more specific in my post and will keep that in mind for future posts. Just FYI I was using a Windows machine and running Python 2.6. Once again thanks for all of your help! Gerad -- http://mail.python.org/mailman/listinfo/python-list

Re: unset TCL_LIBRARY and TK_LIBRARY

2010-04-05 Thread Dave Angel
Wolfman wrote: Hello- was hoping someone could give me a hand in permanently setting my TCL_LIBRARY and TK_LIBRARY. I downloaded Python2.6 to a ThinkPad that came installed with Python2.2, and I can not run IDLE as something automatically sets TCL_LIBRARY and TK_LIBRARY to C:\IBMTools\Python22\

Re: psycopg2 / psycopg2.ProgrammingError: syntax error at or near "E'mytable'"

2010-04-05 Thread mrdrew
Thanks for the replies. The param style is pyformat. I've tried using the '%s' style with a set and get exactly the same error. c.execute('SELECT * FROM %s LIMIT 1',('mytable',)) psycopg2.ProgrammingError: syntax error at or near "E'mytable'" LINE 1: SELECT * FROM E'mytable' LIMIT 1 MRAB and St

Re: passing command line arguments to executable

2010-04-05 Thread mcanjo
On Apr 4, 6:32 am, Simon Brunning wrote: > On 3 April 2010 18:20, mcanjo wrote: > > > I tried doing the following code: > > > from subprocess import Popen > > from subprocess import PIPE, STDOUT > > exefile = Popen('pmm.exe', stdout = PIPE, stdin = PIPE, stderr = > > STDOUT) > > exefile.communica

Re: Interfaces

2010-04-05 Thread Richard Thomas
On Apr 5, 4:40 pm, Roald de Vries wrote: > Dear all, > > PEP 245 and 246 about interfaces for python are both rejected for   > 'something much better' (GvR in 246's rejection notice). Does anybody   > know what this is? I am *very* curious! > > Kind regards, Roald Given that was in 2001, probably

Re: passing command line arguments to executable

2010-04-05 Thread Patrick Maupin
On Apr 5, 11:22 am, mcanjo wrote: > On Apr 4, 6:32 am, Simon Brunning wrote: > > > > > On 3 April 2010 18:20, mcanjo wrote: > > > > I tried doing the following code: > > > > from subprocess import Popen > > > from subprocess import PIPE, STDOUT > > > exefile = Popen('pmm.exe', stdout = PIPE, std

Tkinter inheritance mess?

2010-04-05 Thread ejetzer
For a school project, I'm trying to make a minimalist web browser, and I chose to use Tk as the rendering toolkit. I made my parser classes into Tkinter canvases, so that I would only have to call pack and mainloop functions in order to display the rendering. Right now, two bugs are affecting the p

Re: Tkinter inheritance mess?

2010-04-05 Thread ejetzer
On 5 avr, 12:36, ejetzer wrote: > For a school project, I'm trying to make a minimalist web browser, and > I chose to use Tk as the rendering toolkit. I made my parser classes > into Tkinter canvases, so that I would only have to call pack and > mainloop functions in order to display the rendering

Re: local variable referenced before assignment

2010-04-05 Thread John Nagle
Alf P. Steinbach wrote: Best is however to recognize that you have some state (your variable) and some operations on that state (your callback), and that that is what objects are all about. I.e. wrap your logic in a class. Then 'lastModifiedTime' becomes an instance attribute, and 'handler' be

case insensitive list ?

2010-04-05 Thread Stef Mientki
hello, AFAIK there's no case insensitive list in Python. By case insentive I mean that that sort and memebr of is case insensitive. Does soeone has a implementation of sucha case insensitive list ? thanks, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: local variable referenced before assignment

2010-04-05 Thread Robert Kern
On 2010-04-05 12:08 PM, John Nagle wrote: Alf P. Steinbach wrote: Best is however to recognize that you have some state (your variable) and some operations on that state (your callback), and that that is what objects are all about. I.e. wrap your logic in a class. Then 'lastModifiedTime' become

Re: case insensitive list ?

2010-04-05 Thread Robert Kern
On 2010-04-05 12:17 PM, Stef Mientki wrote: hello, AFAIK there's no case insensitive list in Python. By case insentive I mean that that sort and memebr of is case insensitive. Does soeone has a implementation of sucha case insensitive list ? mylist.sort(key=lambda x: x.lower()) any(x.lower()

Re: folks, what's wrong with this?

2010-04-05 Thread Ani Sinha
> And now for the most import point: __getattr__ is only called as a > *last* resort. That is, after the attribute lookup mechanism will have > tried *and failed* to find the name in the instance's __dict__. Thanks you all for all the suggestions and thoughts. So in other words, this piece of cod

Re: How to access args as a list?

2010-04-05 Thread kj
In <4bb802f7$0$8827$c3e8...@news.astraweb.com> Steven D'Aprano writes: >On Sat, 03 Apr 2010 22:58:43 +, kj wrote: >> Suppose I have a function with the following signature: >> >> def spam(x, y, z): >> # etc. >> >> Is there a way to refer, within the function, to all its arguments as a

Re: local variable referenced before assignment

2010-04-05 Thread Stephen Hansen
On 2010-04-05 10:08:51 -0700, John Nagle said: Yes. Functions with persistent state are generally a bad idea. Unfortunately, the "signal" module requires a callback parameter which is a plain function. So you have to send it a function, closure, or lambda. Here, it's being sent a clos

string.Template question

2010-04-05 Thread Wells Oliver
Can you use dicts with string.Template? e.g. a structure like: game = { 'home': {'team': row['home_team_full'], 'score': row['home_score'], 'record': '0-0', 'pitcher': { 'id': home_pitcher.attrib['id'], 'name': home_pitcher.attrib['last_name'], 'wins': hom

Re: In disGuiodoise?

2010-04-05 Thread News123
Andreas Waldenburger wrote: > On Mon, 05 Apr 2010 13:48:15 +0200 News123 wrote: > >> Martin P. Hellwig wrote: >>> On 04/05/10 00:05, r wrote: >>> However i have also considered that maybe *all* the "well knowns" are in fact the many colorful personalities of Guido. >>> >>> >>> De

Re: string.Template question

2010-04-05 Thread Peter Otten
Wells Oliver wrote: > Can you use dicts with string.Template? > > e.g. a structure like: > > game = { > 'home': {'team': row['home_team_full'], 'score': row['home_score'], > 'record': '0-0', 'pitcher': { > 'id': home_pitcher.attrib['id'], 'name': > home_pitcher.attrib['last_name'], 'wins': home_

Re: Interfaces

2010-04-05 Thread Chris Rebert
On Mon, Apr 5, 2010 at 8:40 AM, Roald de Vries wrote: > Dear all, > > PEP 245 and 246 about interfaces for python are both rejected for 'something > much better' (GvR in 246's rejection notice). Does anybody know what this > is? I am *very* curious! Abstract Base Classes (ABCs) fulfill a similar

PIL question

2010-04-05 Thread Tim Eichholz
I'm trying to cut a BMP with 80 adjacent frames down to 40 using the Image.copy and .paste functions but I'm getting error "ValueError: images do not match" on the paste line. Here is the source --- import sys from PIL import Image if len(sys.argv) == 2: file = sys.argv[1] else: p

Re: C-style static variables in Python?

2010-04-05 Thread Lee Harr
> Another approach would be to stuff the static values in the function's > __dict__. That's how I did it when I wanted something similar. I created this decorator: def static(**kw):     '''     Used to create a decorator function that will add an     attribute to a function and initialize it.

"ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "texas jobs" "texas jobs online" texas j

2010-04-05 Thread saima81
"ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "texas jobs" "texas jobs online" texas job search" http://jobsintexas-usa.blogspot.com/ "ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in

Re: C-style static variables in Python?

2010-04-05 Thread Ethan Furman
Ethan Furman wrote: Steven D'Aprano wrote: On Fri, 02 Apr 2010 19:48:59 -0700, Ethan Furman wrote: The heuristic I use is, if I expect the try block to raise an exception more than about one time in ten, I change to an explicit test. In this case, since the exception should only be raised onc

Re: C-style static variables in Python?

2010-04-05 Thread Patrick Maupin
On Apr 5, 6:50 pm, Ethan Furman wrote: (Posted some code with a timeit...) Well, I'm not going to debug this, but with the *original* thing you posted, and the thing I posted, with a call and everything (more realistic scenario), the exception version seems slower on my machine: #!/usr/bin/env

How to output the commands that are executed in a python script?

2010-04-05 Thread Peng Yu
I want to show what commands have been executed when I run a python script. Is there an option which can instruct python to print the commands automatically? (If you are familiar with R, what I am asking is essentially options(echo=T) in R.) -- Regards, Peng -- http://mail.python.org/mailman/li

Re: Tkinter inheritance mess?

2010-04-05 Thread Lie Ryan
On 04/06/10 02:38, ejetzer wrote: > On 5 avr, 12:36, ejetzer wrote: >> For a school project, I'm trying to make a minimalist web browser, and >> I chose to use Tk as the rendering toolkit. I made my parser classes >> into Tkinter canvases, so that I would only have to call pack and >> mainloop fun

Re: How to output the commands that are executed in a python script?

2010-04-05 Thread Lie Ryan
On 04/06/10 12:38, Peng Yu wrote: > I want to show what commands have been executed when I run a python > script. Is there an option which can instruct python to print the > commands automatically? > > (If you are familiar with R, what I am asking is essentially > options(echo=T) in R.) > It's n

Re: How to output the commands that are executed in a python script?

2010-04-05 Thread Shashwat Anand
You need a debugger here. On Tue, Apr 6, 2010 at 8:41 AM, Lie Ryan wrote: > On 04/06/10 12:38, Peng Yu wrote: > > I want to show what commands have been executed when I run a python > > script. Is there an option which can instruct python to print the > > commands automatically? > > > > (If you

[Click the star to watch this topic] "ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "te

2010-04-05 Thread Naeem
[Click the star to watch this topic] "ADVERTISED JOBS IN TEXAS" "jobs in texas" "jobs in texas usa" "jobs in texas houston" "jobs in texas city" "jobs in texas government" "jobs in texas austin" "texas jobs" "texas jobs online" texas job search" http://jobsintexas-usa.blogspot.com/ [Click the s

Re: How to access args as a list?

2010-04-05 Thread Steve Howell
On Apr 5, 11:49 am, kj wrote: > In <4bb802f7$0$8827$c3e8...@news.astraweb.com> Steven D'Aprano > writes: > > >On Sat, 03 Apr 2010 22:58:43 +, kj wrote: > >> Suppose I have a function with the following signature: > > >> def spam(x, y, z): > >>     # etc. > > >> Is there a way to refer, withi

per-method jit compiler

2010-04-05 Thread Luis M . González
On 4 abr, 00:09, Steven D'Aprano wrote: > On Sat, 03 Apr 2010 22:58:43 +, kj wrote: > > Suppose I have a function with the following signature: > > > def spam(x, y, z): > >     # etc. > > > Is there a way to refer, within the function, to all its arguments as a > > single list?  (I.e. I'm look

per-method jit compiler

2010-04-05 Thread Luis M . González
On 4 abr, 00:09, Steven D'Aprano wrote: > On Sat, 03 Apr 2010 22:58:43 +, kj wrote: > > Suppose I have a function with the following signature: > > def spam(x, y, z): > > # etc. > > Is there a way to refer, within the function, to all its arguments as a > > single list? (I.e. I'm looking

per-function jit compiler

2010-04-05 Thread Luis M . González
This post gave me an idea: http://groups.google.com/group/comp.lang.python/msg/5d75080707104b76 What if I write a simple decorator to figure out the types of every function, and then we use it as a base for a simple method-jit compiler for python? example: def typer(f): def wrap(*args):

Re: per-function jit compiler

2010-04-05 Thread Chris Rebert
2010/4/5 Luis M. González : > This post gave me an idea: > http://groups.google.com/group/comp.lang.python/msg/5d75080707104b76 > > What if I write a simple decorator to figure out the types of every > function, and then we use it as a base for a simple method-jit > compiler for python? > > exampl