KeyError: '13'

2012-06-05 Thread Phanindra Ramesh Challa
I am trying to run a python program. It is giving the KeyError: '13'. I have no clue regarding this error. this is the python code relevant to the error: dpi = 100 bold = 0 italic = 0 mono = 0 comment = "" dbname = "font.db" for o, a in opts: if o == '-b': bold = 1 if o == '-i': italic = 1 if o

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Paul Rubin
Laurent Pointal writes: >> There are a few other things like that, and I'll try to look more >> carefully tonight, I can't spend more time on it right now. > I updated the document into 1.0.5a (and fix some other errors). A few more things: In "Base types" section: unmodifiable => immutable

Re: mistake in python tutorial

2012-06-05 Thread MRAB
On 06/06/2012 03:00, Dave Angel wrote: On 06/05/2012 09:43 PM, Miriam Gomez Rios wrote: Hello, I think that the example in section 4.4 in the tutorial for python 2.7X is wrong. http://docs.python.org/tutorial/controlflow.html It will end up printing this if you run the exact code listed

Re: mistake in python tutorial

2012-06-05 Thread Dave Angel
On 06/05/2012 09:43 PM, Miriam Gomez Rios wrote: > Hello, I think that the example in section 4.4 in the tutorial for python > 2.7X is wrong. > > http://docs.python.org/tutorial/controlflow.html > > > > It will end up printing this if you run the exact code listed in the tutorial. > > > > 3 is a p

mistake in python tutorial

2012-06-05 Thread Miriam Gomez Rios
Hello, I think that the example in section 4.4 in the tutorial for python 2.7X is wrong. http://docs.python.org/tutorial/controlflow.html It will end up printing this if you run the exact code listed in the tutorial. 3 is a prime number 4 equals 2*2 5 is a prime number 5 is a prime numbe

Python Tree datastructure comparison

2012-06-05 Thread Dan Stromberg
I've put together a comparison of some tree datastructures for Python, with varied runtime and varied workload: http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/ I hope to find time to add heaps to the article at some point, but for now, it only covers trees and the treap.

Re: How to exec() a string like interactive python does?

2012-06-05 Thread Steven D'Aprano
On Wed, 06 Jun 2012 00:12:00 +0200, News123 wrote: > If I start Python in interactive mode, and I yype the commands, > 'a=3', 'a', 'print a' > > > Then the output would look like: > >>> a = 3 > >>> a > 3 > >>> print a > 3 > > > Now within an application I'd like to achieve exactly this be

Re: How to exec() a string like interactive python does?

2012-06-05 Thread Devin Jeanpierre
>>> >>> def myexec(s): ... eval(compile(s, '', 'single')) ... >>> x = 3 >>> myexec('x = 4') >>> myexec('x') 3 >>> myexec('print x') 3 >>> On Tue, Jun 5, 2012 at 6:12 PM, News123 wrote: > If I start Python in interactive mode, > and I yype the commands, > 'a=3', 'a', 'print a' > > > Then the  

How to exec() a string like interactive python does?

2012-06-05 Thread News123
If I start Python in interactive mode, and I yype the commands, 'a=3', 'a', 'print a' Then the output would look like: >>> a = 3 >>> a 3 >>> print a 3 Now within an application I'd like to achieve exactly this behaviour Meaning, that - for assignments nothing is displayed - for expressions t

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 5, 10:33 pm, Alain Ketterlin wrote: > richard writes: > >> > An instance of TestArray > >> >  a=a > >> >  b=b > >> >  c=c > >> >  List of 2 A elements: > >> >   Instance of A element > >> >    a=1 > >> >    b=2 > >> >    c=3 > >> >   Instance of A element > >> >    d=1 > >> >    e=2 > >> >

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread MRAB
On 05/06/2012 21:01, Petite Abeille wrote: On Jun 5, 2012, at 8:56 PM, MRAB wrote: valeurs approchées => (not sure) Approximation? I think I understand now: nombres flottants… valeurs approchées! => float-point numbers… approximate values! -- http://mail.python.org/mailman/listi

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread Alain Ketterlin
richard writes: >> > An instance of TestArray >> >  a=a >> >  b=b >> >  c=c >> >  List of 2 A elements: >> >   Instance of A element >> >    a=1 >> >    b=2 >> >    c=3 >> >   Instance of A element >> >    d=1 >> >    e=2 >> >    f=3 >> >  List of 1 B elements >> >   Instance of B element >> >  

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 5, 10:21 pm, richard wrote: > On Jun 5, 9:40 pm, Alain Ketterlin > wrote: > > > > > > > > > > > richard writes: > > > [I'm leaving the data in the message in case anybody has troubles going > > up-thread.] > > > > Hi guys still struggling to get the code that was posted to me on this > >

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 5, 9:40 pm, Alain Ketterlin wrote: > richard writes: > > [I'm leaving the data in the message in case anybody has troubles going > up-thread.] > > > > > > > > > > > Hi guys still struggling to get the code that was posted to me on this > > forum to work in my favour and get the output in t

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 5, 9:40 pm, Alain Ketterlin wrote: > richard writes: > > [I'm leaving the data in the message in case anybody has troubles going > up-thread.] > > > > > > > > > > > Hi guys still struggling to get the code that was posted to me on this > > forum to work in my favour and get the output in t

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread Alain Ketterlin
richard writes: [I'm leaving the data in the message in case anybody has troubles going up-thread.] > Hi guys still struggling to get the code that was posted to me on this > forum to work in my favour and get the output in the format shown > above. This is what I have so far. Any help will be

Re: Your confirmation is required to leave the Python-list mailing list

2012-06-05 Thread mhagbeng
Le 05.06.2012 22:29, python-list-confirm+0ddf652b9a76d520bd9945a702f68cbf7a1d2...@python.org a écrit : Mailing list removal confirmation notice for mailing list Python-list We have received a request for the removal of your email address, "mhagb...@enib.fr" from the python-list@python.org maili

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 5, 8:50 pm, Eelco wrote: > > thank you both for your replies. Unfortunately it is a pre-existing > > file format imposed by an external system that I can't > > change. Thank you for the code snippet. > > Hi Richard, > > Despite the fact that it is a preexisting format, it is very close > in

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Petite Abeille
On Jun 5, 2012, at 8:56 PM, MRAB wrote: > valeurs approchées => (not sure) Approximation? -- http://mail.python.org/mailman/listinfo/python-list

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Laurent Pointal
Paul Rubin wrote: > Laurent Pointal writes: >> I started a first translation of my document originally in french. Could >> some fluent english people read it and indicate errors or bad english >> expressions. >> >> http://perso.limsi.fr/pointal/python:memento > > It looks nice. It took me a min

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread richard
On Jun 4, 3:20 pm, richard wrote: > On Jun 4, 3:14 pm, Alain Ketterlin > wrote: > > > > > > > > > > > richard writes: > > > Hi guys i am having a bit of dificulty finding the best approach / > > > solution to parsing a file into a list of objects / nested objects any > > > help would be greatly

Re: Help needed with nested parsing of file into objects

2012-06-05 Thread Eelco
> thank you both for your replies. Unfortunately it is a pre-existing > file format imposed by an external system that I can't > change. Thank you for the code snippet. Hi Richard, Despite the fact that it is a preexisting format, it is very close indeed to valid YAML code. Writing your own whit

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread MRAB
On 05/06/2012 18:32, Laurent Pointal wrote: Hello, I started a first translation of my document originally in french. Could some fluent english people read it and indicate errors or bad english expressions. http://perso.limsi.fr/pointal/python:memento In addition to what Paul wrote: "mot" =>

Need a Python Developer in Mountain View,CA

2012-06-05 Thread o2kcompliant
Hi Guys, I have a need for a Python Developer in Mountain View,CA. Here are the requirements: Solid foundation in computer science with strong competencies in data structures, algorithms and software design with proficiency in object-oriented design principles and extensive experience in Pyth

Re: English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Paul Rubin
Laurent Pointal writes: > I started a first translation of my document originally in french. Could > some fluent english people read it and indicate errors or bad english > expressions. > > http://perso.limsi.fr/pointal/python:memento It looks nice. It took me a minute to find the English vers

Has theHas Python community got Alan Saalfeld et al's algorithm and source code implementation

2012-06-05 Thread David Shi
Dear Python community friends, I wonder whether there is such a Python implementation available. Alan Saalfeld et al's algorithm and source codes. http://books.google.ie/books/about/A_Modified_Douglas_Peucker_Simplificatio.html?id=gbQjywAACAAJ&redir_esc=y In Zhiyuan Zhao and Alan Saafeld's pap

English version for Mémento Python 3 (draft, readers needed)

2012-06-05 Thread Laurent Pointal
Hello, I started a first translation of my document originally in french. Could some fluent english people read it and indicate errors or bad english expressions. http://perso.limsi.fr/pointal/python:memento Thanks. A+ Laurent. -- Laurent POINTAL - laurent.poin...@laposte.net -- http://mai

Re: what gui designer is everyone using

2012-06-05 Thread Den
On Jun 5, 7:10 am, Mark R Rivet wrote: > I want a gui designer that writes the gui code for me. I don't want to > write gui code. what is the gui designer that is most popular? > I tried boa-constructor, and it works, but I am concerned about how > dated it seems to be with no updates in over six

Re: stop thread from outside 'run'

2012-06-05 Thread MRAB
On 05/06/2012 09:11, Prashant wrote: Hi, I am using tornado web socket server to communicate between python(server) and browser(client). To mimic the behavior of sending data to client and get results back, I am using threaded approach: class JobThread(threading.Thread): "" def

Available candidate for Oracle DBA

2012-06-05 Thread deepak tekwissen
Hi, Hope you are doing good,, Skill SetCurrent-location RelocationAvailability oracal DBAtennessee yes immediately As per your requirement for Oracle DBA position, I’m forwarding you one of my consultant’s

Re: fputs

2012-06-05 Thread Rhodri James
On Tue, 05 Jun 2012 14:54:54 +0100, hassan wrote: what is the equivalent to the php fputs in python The write() method of the file object. Though if you're asking the question like that, you need to read this: http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files ...

Re: fputs

2012-06-05 Thread Ulrich Eckhardt
Am 05.06.2012 15:54, schrieb hassan: > what is the equivalent to the php fputs in python If that fputs() is the same as C's fputs(), then write() is pretty similar. Check the documentation for files, you will surely find the equivalent. Uli -- http://mail.python.org/mailman/listinfo/python-lis

Re: fputs

2012-06-05 Thread Jugurtha Hadjar
On 06/05/2012 02:54 PM, hassan wrote: Dear ALL , what is the equivalent to the php fputs in python regards, Hello, Have you tried something like this (I'll be passing the filename as an argument): from sys import argv script, dest_file = argv data_to_write = raw_input() output = ope

Re: Metaclass of a metaclass

2012-06-05 Thread bruno.desthuilli...@gmail.com
On Jun 5, 10:48 am, Steven D'Aprano wrote: > Apparently it gives an error. Can anyone explain why this does not work? > > # Python 3.2 > > >>> class MyType(type):  # A metaclass... > > ...     def __repr__(self): > ...             s = super().__repr__() > ...             return s.replace('class',

Re: what gui designer is everyone using

2012-06-05 Thread Vincent Vande Vyvre
On 05/06/12 16:10, Mark R Rivet wrote: > I want a gui designer that writes the gui code for me. I don't want to > write gui code. what is the gui designer that is most popular? > I tried boa-constructor, and it works, but I am concerned about how > dated it seems to be with no updates in over six y

Re: what gui designer is everyone using

2012-06-05 Thread parkerdg
On Tuesday, June 5, 2012 10:10:17 AM UTC-4, Manatee wrote: > I want a gui designer that writes the gui code for me. I don't want to > write gui code. what is the gui designer that is most popular? > I tried boa-constructor, and it works, but I am concerned about how > dated it seems to be with no u

Re: what gui designer is everyone using

2012-06-05 Thread rdsteph
On Jun 5, 7:10 am, Mark R Rivet wrote: > I want a gui designer that writes the gui code for me. I don't want to > write gui code. what is the gui designer that is most popular? > I tried boa-constructor, and it works, but I am concerned about how > dated it seems to be with no updates in over six

Re: what gui designer is everyone using

2012-06-05 Thread becky_lewis
I'm afraid that in my experience, doing things by hand has always ended up being quicker and simpler than relying on a GUI designer when it comes to building python GUI apps. That said, I've not tried any for the past few years so there may be a killer app out there that I've not tried :) But even

Re: what gui designer is everyone using

2012-06-05 Thread matteo.bosc...@boscolini.eu
you have the qt designer with eric is nice and easy to use for the qt .. Da: python-list-bounces+matteo.boscolo=boscolini...@python.org A: python-list@python.org Cc: Data: Tue, 05 Jun 2012 10:10:17 -0400 Oggetto: what gui designer is everyone using > I want a gui designer that writes the gui co

what gui designer is everyone using

2012-06-05 Thread Mark R Rivet
I want a gui designer that writes the gui code for me. I don't want to write gui code. what is the gui designer that is most popular? I tried boa-constructor, and it works, but I am concerned about how dated it seems to be with no updates in over six years. -- http://mail.python.org/mailman/listin

fputs

2012-06-05 Thread hassan
Dear ALL , what is the equivalent to the php fputs in python regards, -- http://mail.python.org/mailman/listinfo/python-list

Re: ./configure

2012-06-05 Thread Janet Heath
On Jun 3, 10:01 pm, Janet Heath wrote: > On Jun 3, 6:31 pm, Steven D'Aprano > > > > > > > > > +comp.lang.pyt...@pearwood.info> wrote: > > On Sun, 03 Jun 2012 15:01:07 -0700, Janet Heath wrote: > > > Thanks Alain.  I should have a compiler on my Mac OS X Lion.  I am > > > thinking that it isn't se

Re: Metaclass of a metaclass

2012-06-05 Thread Ian Kelly
On Tue, Jun 5, 2012 at 2:48 AM, Steven D'Aprano wrote: > I was playing around with metaclasses and I wondered what would happen if > the metaclass itself had a metaclass. Sort of a metametaclass. > > Apparently it gives an error. Can anyone explain why this does not work? In your example, Meta is

Twisted 12.1.0 released

2012-06-05 Thread Thomas Hervé
On behalf of Twisted Matrix Laboratories, I am pleased to announce the release of Twisted 12.1. 107 tickets are closed by this release, with the following highlights: * The revival of the kqueue reactor for BSD platforms. * epoll is now the default reactor under Linux after a fix to handle fil

Re: How do I get the constructor signature for built-in types?

2012-06-05 Thread Terry Reedy
On 6/5/2012 1:19 AM, Steven D'Aprano wrote: The inspect.getargspec and getfullargspec functions allow you to extract the function call signature for Python functions and methods. This allows you to work out the constructor signature for pure-Python classes, by calling inspect.getargspec on the __

Re: Namespace hack

2012-06-05 Thread Daniel Fetchinson
>> Funny, you got to the last line of "import this" but apparently >> skipped the second line: >> >> Explicit is better than implicit. >> >> And you didn't even post your message on April 1 so no, I can't laugh >> even though I'd like to. > > Can you be less condescending? Of course! :) Anyway, t

Re: Metaclass of a metaclass

2012-06-05 Thread Peter Otten
Steven D'Aprano wrote: > I was playing around with metaclasses and I wondered what would happen if > the metaclass itself had a metaclass. Sort of a metametaclass. > > Apparently it gives an error. Can anyone explain why this does not work? > > # Python 3.2 > > > class MyType(type): # A

Metaclass of a metaclass

2012-06-05 Thread Steven D'Aprano
I was playing around with metaclasses and I wondered what would happen if the metaclass itself had a metaclass. Sort of a metametaclass. Apparently it gives an error. Can anyone explain why this does not work? # Python 3.2 >>> class MyType(type): # A metaclass... ... def __repr__(self):

stop thread from outside 'run'

2012-06-05 Thread Prashant
Hi, I am using tornado web socket server to communicate between python(server) and browser(client). To mimic the behavior of sending data to client and get results back, I am using threaded approach: class JobThread(threading.Thread): "" def __init__(self, target): ""

Re: How do I get the constructor signature for built-in types?

2012-06-05 Thread Ian Kelly
On Mon, Jun 4, 2012 at 11:19 PM, Steven D'Aprano wrote: > How do I programmatically get the argument spec of built-in types' > __init__ or __new__ methods? I don't think that you can. Methods implemented in C don't really even have established argument specs. They just take tuples and dicts and