best option for python lex/yacc?

2008-06-29 Thread mh
I'm porting a C lex/yacc based project, and would like to redo it in python. What's the best option for a python lex/yacc-like? I've googled a few things, but wanted to see the current concensus. Many TIA! Mark -- Mark Harrison Pixar Animation Studios -- http://mail.python.org/mailman/listinfo

Re: The Importance of Terminology's Quality

2008-06-29 Thread Robert Maas, http://tinyurl.com/uh3t
Why this response is so belated: = > Date: Thu, 05 Jun 2008 11:37:48 +0100 > From: Jon Harrop <[EMAIL PROTECTED]> > We all know that Java, Perl, Python and Lisp suck. Well at least you're three-quarters corr

Chanel shoes - Best High Quality Chanel shoes www.luxury-gift.org

2008-06-29 Thread yxs008
Chanel shoes - Best High Quality Chanel shoes www.luxury-gift.org Luxury Gift : http://www.luxury-gift.org Chanel shoes : http://www.luxury-gift.org/Shoes/Chanel-shoes.html Chanel shoes series contain the following items, each item is the perfect marriage of function and design. Chanel shoes are

Epi Leather Handbags - Louis Vuitton handbags

2008-06-29 Thread yxs008
Epi Leather Handbags - Louis Vuitton handbags Luxury Gift : http://www.luxury-gift.org Louis Vuitton handbags : http://www.luxury-gift.org/Handbags/Louis-Vuitton-handbags.html Epi Leather Handbags : http://www.luxury-gift.org/Handbags/Epi_Leather_1.html Epi Leather Handbags series contain the fo

List Performance

2008-06-29 Thread Ampedesign
If I happen to have a list that contains over 50,000 items, will the size of the list severely impact the performance of appending to the list? -- http://mail.python.org/mailman/listinfo/python-list

Re: How do web templates separate content and logic?

2008-06-29 Thread Guillaume Bog
On Mon, Jun 30, 2008 at 11:27 AM, Tim Roberts <[EMAIL PROTECTED]> wrote: > John Salerno <[EMAIL PROTECTED]> wrote: > > > > > If it seems out of place to you, then you shouldn't do it. In general, you > need to find a model that makes sense to you, and that allows you to write > readable, workable

Re: help debugging noob code - converting binary data to images...

2008-06-29 Thread larry
success, had to fill in a few blanks with some more googling, here is the finished script (used all for loops this time, saved a few more lines): == #!/usr/local/bin/python import string import Image, ImageDraw size = 2 im = Image.new("1",[8*size,8*size],1) draw = ImageDraw.Draw(im)

Re: pixel colour on screen

2008-06-29 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Could anyone help me, I'm a python noob and need some help. im trying >to find some code that will, given a screen co-ordinate, will give me >the colour of that pixel in RGB. i have found a lot about getting the >pixel colour from a picture file with a given co-ordinate,

Re: frame grabber hardware

2008-06-29 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >can anybody recommend a simple USB or PCI framegrabber with video >input that runs under xp and has a python driver available? I just >want to get the image into a file, no special requirements. There are a vast range of inexpensive web cams that will do this job. Logit

Re: [Employment] New TurboGears Job in Eugene, OR

2008-06-29 Thread Tim Roberts
[EMAIL PROTECTED] (Aahz) wrote: >Paul McNett <[EMAIL PROTECTED]> wrote: >> >>They want an expert for a maximum of $25 per hour? If they find someone, >>it'll be a pretty good bullshitter looking for experience. > >Note that it's an "academic year" position -- lots and lots of vacation >time. Thi

Re: How do web templates separate content and logic?

2008-06-29 Thread Tim Roberts
John Salerno <[EMAIL PROTECTED]> wrote: > >No, I don't mean presentation logic at all. I mean something along the >lines of combining HTML (which is what I refer to as "content") and >Python (which is what I meant by "logic"). So for example, if you have >code like this (and this isn't necessari

Re: How to invoke the Python idle

2008-06-29 Thread David
Alon Ben-Ari wrote: Thank you yes I have This is what I got: [EMAIL PROTECTED]:~> idle bash: idle: command not found [EMAIL PROTECTED]:~> Any idea ? Alon On Sun, Jun 29, 2008 at 10:05 PM, David <[EMAIL PROTECTED] > wrote: Only-Trouble wrote: Hi all

Re: How to invoke the Python idle

2008-06-29 Thread John Henderson
Only-Trouble wrote: > Hi all > I am running openSUSE 10.3 > I am learning python on my own, it seems like the system has > already installed a python IDLE > The question is how to invoke it? If it's anything like my Red Hat system, I had to find the command first. In my case, at: /usr/lib/pyth

Re: How to invoke the Python idle

2008-06-29 Thread miya
On Jun 29, 10:01 pm, Only-Trouble <[EMAIL PROTECTED]> wrote: > Hi all > I am running openSUSE 10.3 > I am learning python on my own, it seems like  the system has already > installed a python IDLE > The question is how to invoke it? > > Thanks > > Only-Trouble how about executing from the terminal

Re: Function to import module to namespace

2008-06-29 Thread bvdp
John Machin wrote: Good questions. Short answer ... probably 'cause I've not thought the problem though completely :) > You are updating with *everything* in the 'more' module, not just the > functions. This includes such things as __name__, __doc__, __file__. > Could have interesting side-e

Re: problem with internationalized headers in email package

2008-06-29 Thread Martin v. Löwis
> + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. > + An 'encoded-word' MUST NOT appear within a 'quoted-string'. > + An 'encoded-word' MUST NOT be used in a Received header field. > + An 'encoded-word' MUST NOT be used in parameter of a MIME > Content-Type or Content-Dispos

How to invoke the Python idle

2008-06-29 Thread Only-Trouble
Hi all I am running openSUSE 10.3 I am learning python on my own, it seems like the system has already installed a python IDLE The question is how to invoke it? Thanks Only-Trouble -- http://mail.python.org/mailman/listinfo/python-list

Re: Function to import module to namespace

2008-06-29 Thread John Machin
On Jun 30, 9:52 am, bvdp <[EMAIL PROTECTED]> wrote: > Terry Reedy wrote: > > > > > > > > > > Do you mean something like this? > > > > > >>> math.__dict__.update(string.__dict__) > > >>> dir(math) > > ['Formatter', 'Template', '_TemplateMetaclass', '__builtins__', > > > > I think t

RE: Use of the "is" statement

2008-06-29 Thread Delaney, Timothy (Tim)
Maric Michaud wrote: > Le Friday 27 June 2008 18:26:45 Christian Heimes, vous avez écrit : >> Ask yourself if you are interested if f.tell() returns exactly the >> same 0 object ("is") or a number that is equal to 0 ("=="). > > That said, "f.tell() == 0" and "f.tell() != 0" should be written > "f

Re: Function to import module to namespace

2008-06-29 Thread bvdp
Terry Reedy wrote: > > > Do you mean something like this? > >>> math.__dict__.update(string.__dict__) > >>> dir(math) > ['Formatter', 'Template', '_TemplateMetaclass', '__builtins__', I think this is working First off, 2 module files: funcs.py def func1(): print "I'm func1

Re: Function to import module to namespace

2008-06-29 Thread bvdp
Terry Reedy wrote: bvdp wrote: Is it possible to do this from a function: import a module and append the defs in that module to an existing module/namesapce. So, in my code I have something like: # main code import mods def loadmore(n): import_module(n, mods) # end of main this

Re: UnboundLocalError problems

2008-06-29 Thread Terry Reedy
Mr SZ wrote: Hi, I am writing a small script that changes my pidgin status to away when I lock my screen.I'm using the DBUS API for pidgin and gnome-screensaver.Here's the code: #!/usr/bin/env python import dbus, gobject from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBu

Re: Function to import module to namespace

2008-06-29 Thread Terry Reedy
bvdp wrote: Is it possible to do this from a function: import a module and append the defs in that module to an existing module/namesapce. So, in my code I have something like: # main code import mods def loadmore(n): import_module(n, mods) # end of main this will permit the add

Re: using urllib2

2008-06-29 Thread Jeff McNeil
I didn't spend a lot of time debugging that code -- I've been using beautiful soup a lot at work lately and really pulled that out of memory at about 2:00 AM a couple days ago. In the 5 minute I spent on it, it appeared that the definitions were setup like so: Blah Definition> I was attempti

Re: list extension ?

2008-06-29 Thread Scott David Daniels
Stef Mientki wrote: ... (approximately, I PEP-8'ed it a bit) ... class tGrid_List(list): def __init__(self, value=[]): list.__init__(self, value) # and with this new list component, I can add new attributes on the fly a = tGrid_list([2, 3]) a.New_Attribute = 'some text' # I'm not allow

list extension ?

2008-06-29 Thread Stef Mientki
hello, I basically need a list with a few extra attributes, so I derived a new object from a list, and it works perfect. But I wonder why the newly derived list component is much more flexible ? # so here is the new list object class tGrid_List ( list ) : def __init__ ( self, value = [] ) :

Re: gelato - nvidia and python

2008-06-29 Thread Paul Boddie
On 29 Jun, 17:34, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >>> dir(r) > > ['__call__', '__class__', '__cmp__', '__delattr__', '__doc__', > '__getattribute__', '__hash__', '__init__', '__module__', '__name__', > '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__self__', > '__setattr

UnboundLocalError problems

2008-06-29 Thread Mr SZ
Hi, I am writing a small script that changes my pidgin status to away when I lock my screen.I'm using the DBUS API for pidgin and gnome-screensaver.Here's the code: #!/usr/bin/env python import dbus, gobject from dbus.mainloop.glib import DBusGMainLoop dbus.mainloop.glib.DBusGMainLoop(set_as_

Re: Docutils rst2html.py gives Unknown Directive type "toctree"

2008-06-29 Thread Gerard Flanagan
On Jun 19, 11:19 pm, "Calvin Cheng" <[EMAIL PROTECTED]> wrote: > Hi, > > I am attempting to convert a bunch of .txt files into html using the > docutils package. > > It works for most of the txt files except for the index.txt file which > gives 2 errors: > (1) Unknown Directive type "toctree" > (2

Re: using urllib2

2008-06-29 Thread Alexnb
Okay, now I ran in it the shell, and this is what happened: >>> for tabs in soup.findAll('table', {'class': 'luna-Ent'}): ... tabs.findAll('td')[-1].contents[-1].string ... u' ' u' ' u' ' u' ' u' ' u'not complex or compound; single. ' u' ' u' ' u' ' u' ' u' ' u'inconsequential or rudimentary

Re: gelato - nvidia and python

2008-06-29 Thread name
On Jun 29, 5:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Did somebody worked with gelato from nvidia and python? > I have some C cod from books nvidia . > This is : > " > GelatoAPI *r = GelatoAPI::CreateRenderer(); > r->Camera ("main"); > ... API calls through r ... > r->Render ("main")

Re: Function to import module to namespace

2008-06-29 Thread Cédric Lucantis
Le Sunday 29 June 2008 21:08:36 bvdp, vous avez écrit : > Is it possible to do this from a function: import a module and append > the defs in that module to an existing module/namesapce. > > So, in my code I have something like: > > # main code > import mods > > def loadmore(n): > import_module

Function to import module to namespace

2008-06-29 Thread bvdp
Is it possible to do this from a function: import a module and append the defs in that module to an existing module/namesapce. So, in my code I have something like: # main code import mods def loadmore(n): import_module(n, mods) # end of main this will permit the addition of the th

Re: using urllib2

2008-06-29 Thread Alexnb
Actually after looking at this, the code is preactically the same, except the definitions. So what COULD be going wrong here? Alexnb wrote: > > Okay, so i've hit a new snag and can't seem to figure out what is wrong. > What is happening is the first 4 definitions of the word "simple" don't > sho

Re: tkinter, loading image error, TclError: couldn't recognize data in image file "C:/users/me/desktop/images/blob4.jpg"

2008-06-29 Thread Terry Reedy
defn noob wrote: from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file = 'C:/users/saftarn/desktop/images/blob4.jpg') #im = file = 'C:/users/me/desktop/images/blob4.jpg' pic

Re: using urllib2

2008-06-29 Thread Alexnb
Okay, so i've hit a new snag and can't seem to figure out what is wrong. What is happening is the first 4 definitions of the word "simple" don't show up. The html is basicly the same, with the exception of noun turning into adj. Ill paste the html of the word cheese, and then the one for simple, a

Re: Why is recursion so slow?

2008-06-29 Thread Dan Upton
On Sun, Jun 29, 2008 at 2:35 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > People should read posts to the end before replying, in case it actually > says what one thinks it should, but just in a different order than one > expected. Well, pardon me. -- http://mail.python.org/mailman/listinfo/pyth

Re: Why is recursion so slow?

2008-06-29 Thread Terry Reedy
Dan Upton wrote: On Sun, Jun 29, 2008 at 1:27 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: slix wrote: Recursion is awesome for writing some functions, like searching trees etc but wow how can it be THAT much slower for computing fibonacci- numbers? The comparison below has nothing to do with

Re: C++ or Python

2008-06-29 Thread Dan Stromberg
On Sun, 29 Jun 2008 11:20:45 +0200, Sebastian \"lunar\" Wiesner wrote: > Dan Stromberg <[EMAIL PROTECTED]>: > >> things like passing a method as a function parameter is a no-brainer >> (requires extra syntax in java because of the cautious type system - >> not sure about C++). > > C++ has functi

Re: complex numbers should respect the "I" representation

2008-06-29 Thread Lie
On Jun 29, 8:39 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2008-06-29, Roy Smith <[EMAIL PROTECTED]> wrote: > > >> I think complex numbers should respect the "i" or "I" > >> representation, instead of "j". No reason being cute and using > >> a different character instead of the traditional >

Re: Beginner's Python development questions

2008-06-29 Thread Lie
On Jun 29, 12:46 am, "Łukasz Dąbek" <[EMAIL PROTECTED]> wrote: > Hello! > > I'm newcomer to Python development and I have some questions (I didn't > found answers for these): >     1. Some bugs at bugs.python.org are assigned but it didn't changed > for many months (example:http://bugs.python.org/i

Re: using urllib2

2008-06-29 Thread Jeff McNeil
On Jun 29, 12:50 pm, Alexnb <[EMAIL PROTECTED]> wrote: > No I figured it out. I guess I never knew that you aren't supposed to split a > url like "http://www.goo\ > gle.com" But I did and it gave me all those errors. Anyway, I had a > question. On the original code you had this for loop: > > for ta

Re: using urllib2

2008-06-29 Thread Alexnb
No I figured it out. I guess I never knew that you aren't supposed to split a url like "http://www.goo\ gle.com" But I did and it gave me all those errors. Anyway, I had a question. On the original code you had this for loop: for tabs in soup.findAll('table', {'class': 'luna-Ent'}): yield

Re: Docutils rst2html.py gives Unknown Directive type "toctree"

2008-06-29 Thread Thijs Triemstra | Collab
Getting the same error in the apache logs here, no idea where it's coming from: [Sun Jun 29 18:25:50 2008] [error] :10: (ERROR/3) Unknown directive type "toctree". [Sun Jun 29 18:25:50 2008] [error] [Sun Jun 29 18:25:50 2008] [error] .. toctree:: [Sun Jun 29 18:25:50 2008] [error]:maxdepth: 2

Re: gelato - nvidia and python

2008-06-29 Thread Benjamin Kaplan
On Sun, Jun 29, 2008 at 11:34 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > Did somebody worked with gelato from nvidia and python? > I have some C cod from books nvidia . > This is : > " > GelatoAPI *r = GelatoAPI::CreateRenderer(); > r->Camera ("main"); > ... API calls through r ... > r->R

gelato - nvidia and python

2008-06-29 Thread [EMAIL PROTECTED]
Did somebody worked with gelato from nvidia and python? I have some C cod from books nvidia . This is : " GelatoAPI *r = GelatoAPI::CreateRenderer(); r->Camera ("main"); ... API calls through r ... r->Render ("main"); delete r; // Finished with this renderer " the code for python i create is only

Re: help debugging noob code - converting binary data to images...

2008-06-29 Thread larry
Wonderful, thank you! Will try them out this evening. The image module syntax looks more like what I was expecting than TKinter. All the online drawing examples I found yesterday used TKinter; image was only shown to manipulate pre-made images. Larry -- http://mail.python.org/mailman/listinfo/p

Re: py2exe, PyQT, QtWebKit and jpeg problem

2008-06-29 Thread yang . zengguang
On 6月20日, 下午11时04分, Carbonimax <[EMAIL PROTECTED]> wrote: > hello > > I have a problem with py2exe and QtWebKit : > I make a program with a QtWebKit view. > If I launch the .py directly, all images (jpg, png) are displayed but > if I compile it with py2exe I have only png images. No jpg ! > No erro

Re: Unnormalizing normalized path in Windows

2008-06-29 Thread Duncan Booth
Julien <[EMAIL PROTECTED]> wrote: > In Windows, when a path has been normalized with os.path.normpath, you > get something like this: > > C:/temp/my_dir/bla.txt # With forward slashes instead or backward > slashes. > > Is it possible to revert that? > magic_function('C:/temp/my_dir/bla.t

Re: Why is recursion so slow?

2008-06-29 Thread Jean-Paul Calderone
On Sun, 29 Jun 2008 10:03:46 -0400, Dan Upton <[EMAIL PROTECTED]> wrote: On Sun, Jun 29, 2008 at 1:27 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: slix wrote: Recursion is awesome for writing some functions, like searching trees etc but wow how can it be THAT much slower for computing fibonacc

Re: Testing for Null?

2008-06-29 Thread Chris
On Jun 29, 3:12 am, c0mrade <[EMAIL PROTECTED]> wrote: > Try something like this... > > list = ['lkdfjsldk', None, '', '0', 'slfkjsdlfj', 'lsdgjdlfg', False, True] > for n, it in enumerate(list): >     if not it: print 'Error on this definition' >     else: print '%d. %s' % (n+1, it) > > Results: >

Re: windows installers and license agreement

2008-06-29 Thread Nick Dumas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Darren Dale wrote: > Is it possible to create a windows installer using distutils that > includes a > prompt for the user to agree to the terms of the license? > > Thanks, > Darren Yeah. In your setup.py script, have it pop up a console window with th

Re: Why is recursion so slow?

2008-06-29 Thread Dan Upton
On Sun, Jun 29, 2008 at 1:27 AM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > slix wrote: >> >> Recursion is awesome for writing some functions, like searching trees >> etc but wow how can it be THAT much slower for computing fibonacci- >> numbers? > > The comparison below has nothing to do with re

Unnormalizing normalized path in Windows

2008-06-29 Thread Julien
Hi, In Windows, when a path has been normalized with os.path.normpath, you get something like this: C:/temp/my_dir/bla.txt # With forward slashes instead or backward slashes. Is it possible to revert that? >>> magic_function('C:/temp/my_dir/bla.txt') 'C:\temp\my_dir\bla.txt' I wonder if ther

Re: complex numbers should respect the "I" representation

2008-06-29 Thread Grant Edwards
On 2008-06-29, Roy Smith <[EMAIL PROTECTED]> wrote: >> I think complex numbers should respect the "i" or "I" >> representation, instead of "j". No reason being cute and using >> a different character instead of the traditional >> representation? > > Ask any electrical engineer what j means. And a

Re: pxssh submit su commands = very very slow

2008-06-29 Thread gert
On Jun 29, 4:45 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Sat, 28 Jun 2008 19:08:59 -0700, gert wrote: > > this does the same except 100 times faster ? > > > I don't understand the logic about the prompt, its not the same as the > > output from the bash shell ? > > > [EMAIL PROTECTED]:~# ca

windows installers and license agreement

2008-06-29 Thread Darren Dale
Is it possible to create a windows installer using distutils that includes a prompt for the user to agree to the terms of the license? Thanks, Darren -- http://mail.python.org/mailman/listinfo/python-list

Classical nurses site

2008-06-29 Thread jinole
Recommended for everyone to an Asian pornographic website,There are many beauty photos and movies.URL: http://www.loioi.com If you need more sites, then contact me. e-mail: [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: pixel colour on screen

2008-06-29 Thread Irmen de Jong
Dennis Lee Bieber wrote: On Sat, 28 Jun 2008 11:47:46 -0700 (PDT), [EMAIL PROTECTED] declaimed the following in comp.lang.python: Could anyone help me, I'm a python noob and need some help. im trying to find some code that will, given a screen co-ordinate, will give me the colour of that pixel

tkinter, loading image error, TclError: couldn't recognize data in image file "C:/users/me/desktop/images/blob4.jpg"

2008-06-29 Thread defn noob
from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file = 'C:/users/saftarn/desktop/images/blob4.jpg') #im = file = 'C:/users/me/desktop/images/blob4.jpg' pic = w.create_image(0, 0

problem with internationalized headers in email package

2008-06-29 Thread Manlio Perillo
Hi. From RFC 2047: + An 'encoded-word' MUST NOT appear in any portion of an 'addr-spec'. + An 'encoded-word' MUST NOT appear within a 'quoted-string'. + An 'encoded-word' MUST NOT be used in a Received header field. + An 'encoded-word' MUST NOT be used in parameter of a MIME Content-Type or Cont

Re: What is "@" used for ?

2008-06-29 Thread Lie
On Jun 29, 3:39 pm, gops <[EMAIL PROTECTED]> wrote: > Hi. > > I am noob in python. while reading some source code I came across , > this funny thing called @ in some function , > > def administrator(method): >     @functools.wraps(method) >     def wrapper(self, *args, **kwargs): >         user = u

Re: help debugging noob code - converting binary data to images...

2008-06-29 Thread Lie
On Jun 29, 4:47 pm, Lie <[EMAIL PROTECTED]> wrote: > On Jun 29, 11:18 am, [EMAIL PROTECTED] wrote: > > > > > Ok I'm a Python noob, been doing OK so far, working on a data > > conversion program and want to create some character image files from > > an 8-bit ROM file. > > > Creating the image I've g

Re: help debugging noob code - converting binary data to images...

2008-06-29 Thread Lie
On Jun 29, 11:18 am, [EMAIL PROTECTED] wrote: > Ok I'm a Python noob, been doing OK so far, working on a data > conversion program and want to create some character image files from > an 8-bit ROM file. > > Creating the image I've got down, I open the file and use TK to draw > the images... but > >

Re: HTML Parsing

2008-06-29 Thread Sebastian "lunar" Wiesner
Stefan Behnel <[EMAIL PROTECTED]>: > [EMAIL PROTECTED] wrote: >> I am trying to build my own web crawler for an experiement and I don't >> know how to access HTTP protocol with python. >> >> Also, Are there any Opensource Parsing engine for HTML documents >> available in Python too? That would be

Re: C++ or Python

2008-06-29 Thread Sebastian "lunar" Wiesner
Dan Stromberg <[EMAIL PROTECTED]>: > things like passing a method as a function parameter is a no-brainer > (requires extra syntax in java because of the cautious type system - not > sure about C++). C++ has function pointers and functors, therefore this is not really an issue with C++. -- Fre

What is "@" used for ?

2008-06-29 Thread gops
Hi. I am noob in python. while reading some source code I came across , this funny thing called @ in some function , def administrator(method): @functools.wraps(method) def wrapper(self, *args, **kwargs): user = users.get_current_user() if not user: if self.req