Re: sqlite empty inserts

2008-08-15 Thread Peter Otten
sapsi wrote: > I created a table like: > > create table __saved_query__ (vdb_name text , query_table_name text > PRIMARY KEY, query text) > > and then I insert as follows > > self.cursor.execute( "insert into __saved_query__(vdb_name, > query_table_name, query) values (?,?,?)", (vdbname, >

sqlite empty inserts

2008-08-15 Thread sapsi
Hello, I created a table like: create table __saved_query__ (vdb_name text , query_table_name text PRIMARY KEY, query text) and then I insert as follows self.cursor.execute( "insert into __saved_query__(vdb_name, query_table_name, query) values (?,?,?)", (vdbname, foldername,where_query))

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread Michele Simionato
On Aug 16, 4:48 am, Nadeem <[EMAIL PROTECTED]> wrote: > I understand the 99% rule... the example I gave was to simplify the > issue. The full thing I'm working on is a library for an introductory > CS class I'm teaching. I'm trying, essentially, to build a library of > macros for students to use al

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread Nadeem
That's a really neat way of doing it, thanks a lot! I hadn't realized how accessible all those globals() dictionaries were. Guess my example still falls in the 99%... :) --- nadeem > > def defineStruct(name, *parameters): >   class _struct: >     def __init__(self, *init_parameters): >       for

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread Calvin Spealman
On Fri, Aug 15, 2008 at 10:48 PM, Nadeem <[EMAIL PROTECTED]> wrote: > I understand the 99% rule... the example I gave was to simplify the > issue. The full thing I'm working on is a library for an introductory > CS class I'm teaching. I'm trying, essentially, to build a library of > macros for stud

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread Nadeem
Well, I found one hack that seems to achieve this by accessing the globals() dictionary of the outermost stack frame and adding an entry to it for the newly created functions: import inspect def dynamicdef(name, amt): '''Dynamically defines a new function with the given name that adds the

Re: python interpreter

2008-08-15 Thread Benjamin
On Aug 12, 10:06 am, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > > And keep in mind that reload() is removed in Py3k. Hope this helps. It's not gone; it's just renamed to imp.reload. > > -- > Regards, > Wojtek Walczak,http://www.stud.umk.pl/~wojtekwa/ -- http://mail.python.org/mailman/listinfo/py

Re: Suggestion for improved ImportError message

2008-08-15 Thread Benjamin
On Aug 13, 3:55 pm, Kent Tenney <[EMAIL PROTECTED]> wrote: > Howdy, > > I was just bit by > > from image import annotate > > ImportError: cannot import name annotate > > I found the problem via > > import image > print image.__file__ > > which made it clear that the wrong image module had been foun

Re: Parsing and Editing Source

2008-08-15 Thread Benjamin
On Aug 15, 9:21 am, "Paul Wilson" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'd like to be able to do the following to a python source file > programmatically: >  * Read in a source file >  * Add/Remove/Edit Classes, methods, functions >  * Add/Remove/Edit Decorators >  * List the Classes >  * List

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread Nadeem
I understand the 99% rule... the example I gave was to simplify the issue. The full thing I'm working on is a library for an introductory CS class I'm teaching. I'm trying, essentially, to build a library of macros for students to use allowing them to define records (like structs in C) with selecto

Re: Class definition attribute order

2008-08-15 Thread Benjamin
On Aug 5, 12:53 am, Michele Simionato <[EMAIL PROTECTED]> wrote: > BTW, since I do not really follow python-dev, do you know > if some consensus was reached on the issue of adding an ordered dict > implementation to the standard library? I believe it has been deferred to 2.7/3.1. -- http://mail.p

fare is a Travel search site.

2008-08-15 Thread minu
What is fare? • fare is a Travel search site. • We search the Internet and find you the lowest fares available. • We don't sell you anything; we just connect you directly to Airline, Agency and Wholesale sites to book. • To fare Members, we offer instant online rebates that result in "below market

Re: Dynamically defined functions via exec in imported module

2008-08-15 Thread George Sakkis
On Aug 15, 7:26 pm, Nadeem <[EMAIL PROTECTED]> wrote: > Hello all, > I'm trying to write a function that will dynamically generate other > functions via exec. General tip: whenever you think you need to use exec (or eval), 99% of the time you don't; most of the time there is a better (meaning, le

PIL Question: Inverse of .load()?

2008-08-15 Thread Casey
I'm doing some image processing that requires accessing the individual pixels of the image. I'm using PIL 1.1.6 and creating a 2D array of pixel RGB tuples using the Image class instance load() method. Unfortunately, I can't seem to find a reciprocal function that converts the 2D array of RGB tupl

Re: Confused: looking for a simple XML parser

2008-08-15 Thread Marek Kubica
Hi, On Fri, 15 Aug 2008 17:21:56 -0700, Rex wrote: > What tool should I use? For easy stuff ElementTree (bundled with Python 2.5 but also available to older versions), for more complex stuff lxml (which extends the ET API, so the learning curve is incremental). regards, Marek -- http://mail.p

Confused: looking for a simple XML parser

2008-08-15 Thread Rex
Hello, I am a Python programmer facing my first small XML project. I am looking to find a simple tool to take an XSD file and convert the XSD tree structure to another text format (e.g. an adjacency matrix for the tree's graph), or convert one xml file format definition into another, non-xml one.

IMAP

2008-08-15 Thread [EMAIL PROTECTED]
Hi, I am new to python and I need to use it to implement for my dissertation. The idea behind is used to send the message to mail server and look for it's respond time (Microseconds measurement). How to write the response time and throughput in Imap? Thanks ahead of time. -- http://mail.python.org/

Dynamically defined functions via exec in imported module

2008-08-15 Thread Nadeem
Hello all, I'm trying to write a function that will dynamically generate other functions via exec. I then want to be able to import the file (module) containing this function and use it in other modules, but for some reason it only works using the "import " syntax, and not "from import *" syntax..

Re: Missing exceptions in PEP 3107

2008-08-15 Thread Terry Reedy
Christoph Zwerschke wrote: That's not quite true: PEP 3017 describes a mechanism for annotating function parameters *and return values*, and my point was why it does not provide a mechanism for annotating thrown exceptions, since I see info on thrown exceptions in the same category as info o

Re: negative numbers are not equal...

2008-08-15 Thread Christian Heimes
ariel ledesma wrote: well, i'm glad i stumbled upon this detail early on (i only had to fix about one page of code)... i'll just stick to 'is' when it concerns checking if it is the *same* object (memorywise) instead of an *equivalent* one... just before wrapping up, the special methods __eq__

Re: Code works in current dir only?

2008-08-15 Thread Paxton Sanders
>> Does anyone know why the following code successfully labels (with >> [f|d|?]) entries in the current directory, but not in any other >> directory? (All other directories' entries print [?].) > n = os.path.join(path, n) ### <== you need this Oops, there it is: my stupidity on displ

Re: Code works in current dir only?

2008-08-15 Thread Dieter Deyke
Paxton Sanders <[EMAIL PROTECTED]> writes: > Does anyone know why the following code successfully labels (with [f|d|?]) > entries in the current directory, but not in any other > directory? (All other directories' entries print [?].) > > I'm using Python 2.5.1 on Cygwin. > > Thanks! > > import

Code works in current dir only?

2008-08-15 Thread Paxton Sanders
Does anyone know why the following code successfully labels (with [f|d|?]) entries in the current directory, but not in any other directory? (All other directories' entries print [?].) I'm using Python 2.5.1 on Cygwin. Thanks! import os # collect all files and their paths def collectinfo(pat

New sample codes, building CGameMain class - Game programming

2008-08-15 Thread smartx
New sample codes, direct x game programming at: http://gptutors.com With best wishes, smartx. -- http://mail.python.org/mailman/listinfo/python-list

Re: negative numbers are not equal...

2008-08-15 Thread ariel ledesma
well, i'm glad i stumbled upon this detail early on (i only had to fix about one page of code)... i'll just stick to 'is' when it concerns checking if it is the *same* object (memorywise) instead of an *equivalent* one... just before wrapping up, the special methods __eq__ and __ne__ are called

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Christian Heimes
Bruno Desthuilliers wrote: How often do you really need to override a property ? (hint : as far as I'm concerned, it never happened so far). Now you have two solutions : either redefine the whole property in the derived class, or, if you really intend your property to be overriden, provide a "t

Re: negative numbers are not equal...

2008-08-15 Thread Dan Lenski
On Fri, 15 Aug 2008 08:03:23 -0700, Carl Banks wrote: > On Aug 14, 4:42 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: >> Integers >> between -5 and +256 are singletons as are some other objects like >> strings with one element or empty tuples. > > Not quite. > > Python 2.5.2 (r252:60911, May 2

Job: Turbogears

2008-08-15 Thread Shemia Miller
I have the site up. The programmer has installed it. I now need a simple admin panel to go with it. Please let me know if you, or you know anyone who could create one? -- Phone Number: (641) 715-3900 Extension: 66984# Please allow 24-48 hrs. -- http://mail.python.org/mailman/listinfo/python-li

Re: negative numbers are not equal...

2008-08-15 Thread Bruno Desthuilliers
Terry Reedy a écrit : Mel wrote: castironpi wrote: It would be nice to put together a really canonical case of the use of the 'is' comparison. FTSOA for the sake of argument, when do you use it? Why is it even in the language? My poster child use case is in a MUDD game. For instance, the

Re: Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Bruno Desthuilliers
Rafe a écrit : Hi, I've been thinking in circles about these aspects of Pythonic design and I'm curious what everyone else is doing and thinks. There are 3 issues here: 1) 'Declaring' attributes There's nothing like "declaration" of variables/attributes/whatever in Python. - I always fel

Re: Pre-university student looking to contribute to OS project

2008-08-15 Thread Stef Mientki
Jason Walsh wrote: I'm a pre-university student with about 7 months Python experience looking for an open source project to get involved in (learn the code, do bug fixes, etc). I've searched freshmeat.net, SourceForge, and Google Code, and found a few possibilities, but I thought I'd ask the lis

Re: Missing exceptions in PEP 3107

2008-08-15 Thread Christoph Zwerschke
Carl Banks wrote: > I think you're missing the point here. PEP 3017 is policy-neutral: > it describes a mechanism to annotate functions and arguments, > and that's it. That's not quite true: PEP 3017 describes a mechanism for annotating function parameters *and return values*, and my point was w

Pre-university student looking to contribute to OS project

2008-08-15 Thread Jason Walsh
I'm a pre-university student with about 7 months Python experience looking for an open source project to get involved in (learn the code, do bug fixes, etc). I've searched freshmeat.net, SourceForge, and Google Code, and found a few possibilities, but I thought I'd ask the list and see if there ar

Re: negative numbers are not equal...

2008-08-15 Thread Terry Reedy
Mel wrote: castironpi wrote: It would be nice to put together a really canonical case of the use of the 'is' comparison. FTSOA for the sake of argument, when do you use it? Why is it even in the language? My poster child use case is in a MUDD game. For instance, the player represented by

Re: Missing exceptions in PEP 3107

2008-08-15 Thread Christoph Zwerschke
Matimus wrote: > Christoph wrote: >> Maybe the following syntax would be even more intuitive: >> >> def foo(a: "a info", b: "b info") return "ret info" raise "exc info": >> return "hello world" > > That seems much more intuitive and extensible. The "->" syntax has > always bothered me. The

Re: negative numbers are not equal...

2008-08-15 Thread Mel
castironpi wrote: > It would be nice to put together a really canonical case of the use of > the 'is' comparison. FTSOA for the sake of argument, when do you use > it? Why is it even in the language? My poster child use case is in a MUDD game. For instance, the player represented by `this_playe

Re: precedence of [] vs .

2008-08-15 Thread Terry Reedy
Fredrik Lundh wrote: Calvin Spealman wrote:e attribute access (foo.bar) binds more tightly than subscripting (foo[bar]). no, they have the same binding power; here's the relevant part of the grammar: trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME note however that "."

Re: Passing an object through COM which acts like str but isn't

2008-08-15 Thread Wolfgang Grafen
Rafe schrieb: On Aug 15, 10:27 pm, Wolfgang Grafen <[EMAIL PROTECTED]> wrote: Rafe schrieb: Now if I try to pass this as I would a string, roughly like so... s = StrLike("test") Application.AnObject.attribute = "test" # works fine Application.AnObject.attribute = s ERROR : Traceback (most re

Re: Create a process with a "time to live"

2008-08-15 Thread Fredrik Lundh
Carl J. Van Arsdall wrote: I want to create a process that would "expire" if it didn't complete in a set amount of time. I don't seem to see any timeout values to pass os.system - does anyone know of a good way to do this? So far all I can think of is some kind of watchdog thread - but that s

Re: wxPython beginners problem

2008-08-15 Thread Mike Driscoll
On Aug 15, 11:31 am, Ivan Reborin <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm new to python, new as newbies get, so please, don't take wrongly > if this seems like a stupid or overly simple question. > > I'm going through examples in a book I have ("Beginning python", by > Hetland Marcus) and I

Handling Property and internal ('__') attribute inheritance and creation

2008-08-15 Thread Rafe
Hi, I've been thinking in circles about these aspects of Pythonic design and I'm curious what everyone else is doing and thinks. There are 3 issues here: 1) 'Declaring' attributes - I always felt it was good code practice to declare attributes in a section of the class namespace. I set anything

Re: wxPython beginners problem

2008-08-15 Thread s0suk3
On Aug 15, 11:31 am, Ivan Reborin <[EMAIL PROTECTED]> wrote: > Hello all, > > I'm new to python, new as newbies get, so please, don't take wrongly > if this seems like a stupid or overly simple question. > > I'm going through examples in a book I have ("Beginning python", by > Hetland Marcus) and I

Re: Digitally sign PDF files

2008-08-15 Thread John Krukoff
On Mon, 2008-08-11 at 14:13 -0700, haxier wrote: > On 11 ago, 22:29, Hartmut Goebel <[EMAIL PROTECTED]> wrote: > > > > I'm developing an application with some reports and we're looking for > > > advice. This reports should be openoffice.org .odf files, pdf files, > > > and perhaps microsoft word f

Re: Create a process with a "time to live"

2008-08-15 Thread John Krukoff
On Fri, 2008-08-15 at 10:00 -0700, Carl J. Van Arsdall wrote: > Hey python[], > > I want to create a process that would "expire" if it didn't complete in > a set amount of time. I don't seem to see any timeout values to pass > os.system - does anyone know of a good way to do this? > > So far

Re: emacs python modes [was Re: python/python output buffers]

2008-08-15 Thread sandro dentella
> > This has been the subject of a recent thread here. Emacs now ships with > a different python mode named python.el. You'll have to manually > (re)install the original python-mode.el. > > HTH Thanks. I did search for it and got lost in too many different post on python mode... Now I found it.

Re: negative numbers are not equal...

2008-08-15 Thread Fredrik Lundh
castironpi wrote: This case actually misses handleC(). The solution is that the function that is returning '-10' cannot return -10, it has to return flagC. This can cause difficulties in cases when you're doing operations on flags. Worse, if flagC is nested somewhere, say moduleA.classB.flagC

Re: wxPython beginners problem

2008-08-15 Thread Brian Victor
Ivan Reborin wrote: > win.Show This line isn't doing anything. It needs to be: win.Show() # note the parentheses -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying ZODB, background in Relational: mimic auto_increment?

2008-08-15 Thread Maric Michaud
Le Thursday 14 August 2008 20:14:19 Christian Heimes, vous avez écrit : > Diez B. Roggisch wrote: > > But that's a great deal more complicated! It requires merging, and while > > this of course is possible, you should have mentioned it because > > otherwise the OP might run into problems. > > A loc

Re: Digitally sign PDF files

2008-08-15 Thread Hartmut Goebel
haxier schrieb: > M2Crypto? I didn't know of it... surely I must check it. > > It's a very delicate component (security and reliability is a must) > and don't know how openssl works in windows environments. M2crypto is available for windows, too. So I would not expect any problems here. > The b

Create a process with a "time to live"

2008-08-15 Thread Carl J. Van Arsdall
Hey python[], I want to create a process that would "expire" if it didn't complete in a set amount of time. I don't seem to see any timeout values to pass os.system - does anyone know of a good way to do this? So far all I can think of is some kind of watchdog thread - but that seems like o

Re: negative numbers are not equal...

2008-08-15 Thread Bruno Desthuilliers
castironpi a écrit : (snip) It would be nice to put together a really canonical case of the use of the 'is' comparison. FTSOA for the sake of argument, when do you use it? When I want to test objects identity. An idenity test is an identity test is an identity test is an Why is it eve

Re: You advice please

2008-08-15 Thread castironpi
On Aug 15, 10:05 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Hussein B a écrit : > (snip) > > > But this critisim looks so serious: > >http://en.wikipedia.org/wiki/Ruby_programming_language#Criticism > (snip) > the usual paranoïa from bondage&discipline language addicts Ooo... well said.

Re: wxPython beginners problem

2008-08-15 Thread Ivan Reborin
On Fri, 15 Aug 2008 18:31:16 +0200, Ivan Reborin <[EMAIL PROTECTED]> wrote: >Hello all, > >I'm new to python, new as newbies get, so please, don't take wrongly >if this seems like a stupid or overly simple question. > >I'm going through examples in a book I have ("Beginning python", by >Hetland Ma

Re: negative numbers are not equal...

2008-08-15 Thread castironpi
On Aug 15, 8:56 am, Dan Lenski <[EMAIL PROTECTED]> wrote: > On Thu, 14 Aug 2008 17:18:55 -0300, ariel ledesma wrote: > > hello guys > > > i just ran into this when comparing negative numbers, they start > > returning False from -6 down, but only when comparing with 'is' > > >  >>> m = -5 > >  >>> a

Re: You advice please

2008-08-15 Thread Bruno Desthuilliers
Hussein B a écrit : (snip) But this critisim looks so serious: http://en.wikipedia.org/wiki/Ruby_programming_language#Criticism Most of what's written here could apply to Python too - all the part which mostly reflects the usual paranoïa from bondage&discipline langages addicts wrt/ dynamic l

emacs python modes [was Re: python/python output buffers]

2008-08-15 Thread Bruno Desthuilliers
sandro dentella a écrit : Hi, I'm having a little problem while using python mode. I'm used to hit C-c C-c and have a Python Output buffer opened with the output. Now, on Ubuntu 7.10 and 8.04, C-c C-c sends to the Python buffer that is not raised in a window. I need to hit C-c C-z to see it.

wxPython beginners problem

2008-08-15 Thread Ivan Reborin
Hello all, I'm new to python, new as newbies get, so please, don't take wrongly if this seems like a stupid or overly simple question. I'm going through examples in a book I have ("Beginning python", by Hetland Marcus) and I just started doing wxPython examples. But every sample I try, for examp

ANN: Leo 4.5 beta 3 released

2008-08-15 Thread Edward K Ream
Leo 4.5 beta 3 is now available at: http://sourceforge.net/project/showfiles.php?group_id=3458&package_id=29106 Leo 4.5 contains many important new features. See below for details. Leo is a text editor, data organizer, project manager and much more. See: http://webpages.charter.net/edreamleo/int

python/python output buffers

2008-08-15 Thread sandro dentella
Hi, I'm having a little problem while using python mode. I'm used to hit C-c C-c and have a Python Output buffer opened with the output. Now, on Ubuntu 7.10 and 8.04, C-c C-c sends to the Python buffer that is not raised in a window. I need to hit C-c C-z to see it. First of all I'm puzzled

Re: Parsing and Editing Source

2008-08-15 Thread Wilson
On Aug 15, 4:16 pm, Rafe <[EMAIL PROTECTED]> wrote: > On Aug 15, 9:21 pm, "Paul Wilson" <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > I'd like to be able to do the following to a python source file > > programmatically: > >  * Read in a source file > >  * Add/Remove/Edit Classes, methods, func

Re: Passing an object through COM which acts like str but isn't

2008-08-15 Thread Rafe
On Aug 15, 10:27 pm, Wolfgang Grafen <[EMAIL PROTECTED]> wrote: > Rafe schrieb: > > > Forgive me if I mangle any terminology here, but please correct me if > > I do... > > > I have an object which acts exactly like a string as long as I stay in > > Python land. However, I am using the object in Sof

Re: Passing an object through COM which acts like str but isn't

2008-08-15 Thread Wolfgang Grafen
Rafe schrieb: Forgive me if I mangle any terminology here, but please correct me if I do... I have an object which acts exactly like a string as long as I stay in Python land. However, I am using the object in Softimage|XSI, a 3D application on Windows. I'm getting variant erros when trying to u

Re: How do I control output buffering on Win32?

2008-08-15 Thread Wojtek Walczak
On Fri, 15 Aug 2008 09:47:34 -0500, Grant Edwards wrote: > When I ssh in to my Windows XP box and run Python apps, output > from "print" and and "sys.stdout.write()" is being buffered so > that none of the output shows up until the program exits. > > From within my program how do I set output buff

Re: Parsing and Editing Source

2008-08-15 Thread Rafe
On Aug 15, 9:21 pm, "Paul Wilson" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'd like to be able to do the following to a python source file > programmatically: > * Read in a source file > * Add/Remove/Edit Classes, methods, functions > * Add/Remove/Edit Decorators > * List the Classes > * List

Re: How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
On 2008-08-15, Grant Edwards <[EMAIL PROTECTED]> wrote: >> I'm not sure you can do that from within the program [1]; to >> do it from the outside, set the PYTHONUNBUFFERED environment >> variable to something, or pass "-u" to the interpreter. > > I had seen references to PYTHONUNBUFFERED in my Goo

Re: How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
On 2008-08-15, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Grant Edwards wrote: > >> When I ssh in to my Windows XP box and run Python apps, output >> from "print" and and "sys.stdout.write()" is being buffered so >> that none of the output shows up until the program exits. >> >>>From within my pr

Re: negative numbers are not equal...

2008-08-15 Thread Carl Banks
On Aug 14, 4:42 pm, Christian Heimes <[EMAIL PROTECTED]> wrote: > Integers > between -5 and +256 are singletons as are some other objects like > strings with one element or empty tuples. Not quite. Python 2.5.2 (r252:60911, May 28 2008, 08:35:32) [GCC 4.2.4 (Debian 4.2.4-1)] on linux2 Type "help"

Re: How do I control output buffering on Win32?

2008-08-15 Thread Fredrik Lundh
Grant Edwards wrote: When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. From within my program how do I set output buffering to either line-buffered or un-buff

Re: Early halt for iterating a_list and iter(a_list)

2008-08-15 Thread Fredrik Lundh
Lie wrote: When you've got a nested loop a StopIteration in the Inner Loop would break the loop for the outer loop too: a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5] def looper(a, b, c): for a_ in a: for b_ in b: for c_ in c: print a_, b_, c_ loope

Re: Parsing and Editing Source

2008-08-15 Thread Wilson
On Aug 15, 3:45 pm, eliben <[EMAIL PROTECTED]> wrote: > On Aug 15, 4:21 pm, "Paul Wilson" <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > I'd like to be able to do the following to a python source file > > programmatically: > >  * Read in a source file > >  * Add/Remove/Edit Classes, methods, fu

How do I control output buffering on Win32?

2008-08-15 Thread Grant Edwards
When I ssh in to my Windows XP box and run Python apps, output from "print" and and "sys.stdout.write()" is being buffered so that none of the output shows up until the program exits. >From within my program how do I set output buffering to either line-buffered or un-buffered? [I'm looking for t

Re: Parsing and Editing Source

2008-08-15 Thread eliben
On Aug 15, 4:21 pm, "Paul Wilson" <[EMAIL PROTECTED]> wrote: > Hi all, > > I'd like to be able to do the following to a python source file > programmatically: >  * Read in a source file >  * Add/Remove/Edit Classes, methods, functions >  * Add/Remove/Edit Decorators >  * List the Classes >  * List

Early halt for iterating a_list and iter(a_list)

2008-08-15 Thread Lie
When you've got a nested loop a StopIteration in the Inner Loop would break the loop for the outer loop too: a, b, c = [1, 2, 3], [1, 2, 3, 4], [1, 2, 3, 4, 5] def looper(a, b, c): for a_ in a: for b_ in b: for c_ in c: print a_, b_, c_ looper(a, b, c) #

Re: Cannot download SendKeys module

2008-08-15 Thread kpd
Thanks Stef. The Rutherfurd.net site is back online this morning too. -- http://mail.python.org/mailman/listinfo/python-list

Re: Don´t find HTMLgen

2008-08-15 Thread Walter Dörwald
Gabriel Genellina wrote: > En Thu, 14 Aug 2008 17:10:26 -0300, <[EMAIL PROTECTED]> > escribi�: > >> I am looking for HTMLgen module but not to find this, the link >> referenced in www.python.org it does not exist. >> >> I have need to develop in cgi and would want to do it of the possible >> tra

Parsing and Editing Source

2008-08-15 Thread Paul Wilson
Hi all, I'd like to be able to do the following to a python source file programmatically: * Read in a source file * Add/Remove/Edit Classes, methods, functions * Add/Remove/Edit Decorators * List the Classes * List the imported modules * List the functions * List methods of classes And the

Re: getattr nested attributes

2008-08-15 Thread Fredrik Lundh
Gregor Horvath wrote: Thank's, but this does not work for this case: class A(object): test = "test" class B(object): a = [A(),] In [70]: reduce(getattr, "a[0].test".split("."), B) --- Traceback (most recen

Re: help on import libxml2

2008-08-15 Thread jianbing . chen
Paul, Thanks. This helped. Jianbing On Aug 14, 4:10 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 14 Aug, 22:43, [EMAIL PROTECTED] wrote: > > > > > Traceback (most recent call last): > >   File "", line 1, in > >   File "/sea/local/lib/python2.5/site-packages/libxml2.py", line 1, in > > > >

Re: Tkinter updates - Easiest way to install/use Tile?

2008-08-15 Thread Mudcat
Thanks for all the input! I was able to install 2.6 with the wrapper file and get up and running quickly. I like this. I can pass the style object to a separate stylesheet file where I can create all the definitions. That cleans up a lot of clutter around the gui widgets. In the past there just di

Re: Passing an object through COM which acts like str but isn't

2008-08-15 Thread Rafe
Forgive me if I mangle any terminology here, but please correct me if I do... I have an object which acts exactly like a string as long as I stay in Python land. However, I am using the object in Softimage|XSI, a 3D application on Windows. I'm getting variant erros when trying to use my instances

Re: negative numbers are not equal...

2008-08-15 Thread Dan Lenski
On Thu, 14 Aug 2008 17:18:55 -0300, ariel ledesma wrote: > hello guys > > i just ran into this when comparing negative numbers, they start > returning False from -6 down, but only when comparing with 'is' > > >>> m = -5 > >>> a = -5 > >>> m is a > True > >>> m = -6 > >>> a = -6 > >>> m is

Re: getattr nested attributes

2008-08-15 Thread Paul Boddie
On 15 Aug, 10:35, Gregor Horvath <[EMAIL PROTECTED]> wrote: > > : type object 'B' has no attribute > 'a.test' You have to realise that attributes can have names beyond those supported by the usual attribute access syntax. For example: class C: pass setattr(C, "x.y", 123) getattr(C, "x.y")

ANN: pyglet 1.1

2008-08-15 Thread Alex Holkner
pyglet 1.1 has been released, with many new features since pyglet 1.0 (scroll down for details). http://www.pyglet.org --- pyglet provides an object-oriented programming interface for developing games and other visually-rich applications for Windows, Mac OS X and Linux. Some of the features of p

Re: Passing an object through COM which acts like str but isn't

2008-08-15 Thread Rafe
The previous message was posted prematurely. Please ignore it. (I hit enter witht he wrong focus I guess...no confirmation or edit available? This was my first post.) - Rafe -- http://mail.python.org/mailman/listinfo/python-list

Passing an object through COM which acts like str but isn't

2008-08-15 Thread Rafe
Forgive me if I mangle any terminology here, but please correct me if I do... I have an object which acts exactly like a string as long as I stay in Python land. However, I am using the object in Softimage|XSI a 3D application on Windows. It was created while (briefly) owned by Microsoft, so knowl

Re: negative numbers are not equal...

2008-08-15 Thread Steven D'Aprano
On Thu, 14 Aug 2008 20:44:32 -0700, castironpi wrote: > For > > a= 6 > b= a > > the test > > a is b > > should clearly return true. Since Python promises not to make a copy of a when you execute "b = a", then I think that such behaviour is guaranteed by the language. > Python distinguishes

Re: Suggestion for improved ImportError message

2008-08-15 Thread bearophileHUGS
Lie: >I'm not sure there are any reason to test for failed import in doctest)< I have code that uses numpy if available, otherwise uses slower normal Python code. Inside the doctests I'd like to test both situations... Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Don´t find HTMLgen

2008-08-15 Thread econtreras . bantech
On 15 ago, 00:10, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Thu, 14 Aug 2008 17:10:26 -0300, <[EMAIL PROTECTED]>   > escribi : > > > I am looking for HTMLgen module but not to find this, the link > > referenced inwww.python.orgit does not exist. > > > I have need to develop in cgi and wo

Re: getattr nested attributes

2008-08-15 Thread Steven D'Aprano
On Fri, 15 Aug 2008 11:12:04 +0200, Gregor Horvath wrote: > Peter Otten schrieb: > >> make your own function that loops over the attributes, or spell it >> > reduce(getattr, "a.test".split("."), B) >> 'test' >> >> > Thank's, but this does not work for this case: > > class A(object): >

framework for web-based data visualization

2008-08-15 Thread JustWant2Ask JustWant2Ask
Hi, I would like to hear peoples opinion on different frameworks available (django, turbogears, pylon ...) that can provide a quick start into building web applications with the following features: - Server-side scripting - Connection to MySQL - Ease for large data-sets store in memory (potential

Re: Fixed-length text file to database script

2008-08-15 Thread Lie
On Aug 15, 7:12 am, John Machin <[EMAIL PROTECTED]> wrote: > On Aug 15, 4:55 am, [EMAIL PROTECTED] wrote: > > > #your thought is right. > > === > > def sizes2fields(sizes): > >    d = [] > >    begin = 0 > >    for i in sizes: > >       if begin:

Re: Python regex question

2008-08-15 Thread Tim N. van der Leeuw
Hey Gerhard, Gerhard Häring wrote: > > Tim van der Leeuw wrote: >> Hi, >> >> I'm trying to create a regular expression for matching some particular >> XML strings. I want to extract the contents of a particular XML tag, >> only if it follows one tag, but not follows another tag. Complicating

Re: a podcast for music algo-comped with python

2008-08-15 Thread Paul Boddie
On 15 Aug, 05:50, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 14, 4:01 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > > > I'm not sure if I follow the question. I don't have much experience > > with making sound effects, preferring to compose and "pre-render" my > > music, but I imagine there are

Re: You advice please

2008-08-15 Thread Lie
On Aug 13, 6:14 pm, Hussein B <[EMAIL PROTECTED]> wrote: > Hey, > I'm a Java/Java EE developer and I'm playing with Python these days. > I like the Python language so much and I like its communities and the > Django framework. > My friends are about to open a Ruby/Rails shop and they are asking me

Re: Suggestion for improved ImportError message

2008-08-15 Thread Lie
On Aug 14, 5:10 pm, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Thu, 14 Aug 2008 01:35:44 + (UTC), Kent Tenney wrote: > >> > Then go for it  You can prepare a patch and ask on python-dev > >> > if the developers are interested. > > > hehe, I'll get a C level patch accepted right after I > >

EARN MONEY $1500-$5000 PER MONTH

2008-08-15 Thread pooja
EARN MONEY $1500-$5000 PER MONTH SIMPLE ONLINE SURVEY CREATE UR ACCOUNT AND EARN IMMEDIATLY * http://www.AWSurveys.com/HomeMain.cfm?RefID=kingraja666 * --

EARN MONEY $1500-$5000 PER MONTH

2008-08-15 Thread pooja
EARN MONEY $1500-$5000 PER MONTH SIMPLE ONLINE SURVEY CREATE UR ACCOUNT AND EARN IMMEDIATLY * http://www.AWSurveys.com/HomeMain.cfm?RefID=kingraja666 * --

EARN MONEY $1500-$5000 PER MONTH

2008-08-15 Thread pooja
EARN MONEY $1500-$5000 PER MONTH SIMPLE ONLINE SURVEY CREATE UR ACCOUNT AND EARN IMMEDIATLY * http://www.AWSurveys.com/HomeMain.cfm?RefID=kingraja666 * --

EARN MONEY $1500-$5000 PER MONTH

2008-08-15 Thread pooja
EARN MONEY $1500-$5000 PER MONTH SIMPLE ONLINE SURVEY CREATE UR ACCOUNT AND EARN IMMEDIATLY * http://www.AWSurveys.com/HomeMain.cfm?RefID=kingraja666 * --

EARN MONEY $1500-$5000 PER MONTH

2008-08-15 Thread pooja
EARN MONEY $1500-$5000 PER MONTH SIMPLE ONLINE SURVEY CREATE UR ACCOUNT AND EARN IMMEDIATLY * http://www.AWSurveys.com/HomeMain.cfm?RefID=kingraja666 * --

  1   2   >