Re: Structures

2008-11-03 Thread Craig Allen
> > Care to say more about what they are, not what they're like? > I'm not the OP and I may be biased by C++, I can imagine the complaints when I say, classes are just structures with function members for working on the structure. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unyeilding a permutation generator

2008-11-03 Thread Aaron Brady
On Nov 3, 4:13 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 03 Nov 2008 21:09:58 +, Jorgen Grahn wrote: > > Why multi-threading?  I see no concurrency in the original algorithm. > > There is, in my mind, nothing concurrent about 'yield'. > > No "real" concurrency but a gene

Re: Finding the instance reference of an object

2008-11-03 Thread Joe Strout
On Nov 3, 2008, at 2:36 PM, Aaron Brady wrote: Then please write the Python equivalent of the "Swap" methods shown at (or at , for that matter). And no fair wrapping the two parameters up in an object

Re: Structures

2008-11-03 Thread Jorgen Grahn
On Mon, 3 Nov 2008 20:33:45 +, Paulo J. Matos <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 12:32 PM, Ben Finney > <[EMAIL PROTECTED]> wrote: >> "Paulo J. Matos" <[EMAIL PROTECTED]> writes: ... >> I'm wondering a more fundamental question: What are structures? That >> is, what do *you* me

Re: Replacing cmp with key for sorting

2008-11-03 Thread bearophileHUGS
George Sakkis: > but I guess there's not much more room for improvement. That's nonsense, Python is a high level language, so there's nearly always room for improvement (even in programs written in assembly you can generally find faster solutions). If speed is what you look for, and your strings a

Re: Structures

2008-11-03 Thread Arnaud Delobelle
Craig Allen <[EMAIL PROTECTED]> writes: >> >> Care to say more about what they are, not what they're like? >> > > I'm not the OP and I may be biased by C++, I can imagine the > complaints when I say, classes are just structures with function > members for working on the structure. In C++ classes

Re: Unyeilding a permutation generator

2008-11-03 Thread sillyhat
On Nov 3, 4:24 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Nov 2, 10:34 pm, [EMAIL PROTECTED] wrote: > > > Anyway what I want to do is experiment with code similar to this (i.e. > > same algorithm and keep the recursion) in other languages, > > particularly vbscript and wondered what it w

problem with quote and single-quote when using "subprocess"

2008-11-03 Thread Evan
Hello - i'm trying to call subprocess.popen on the 'command-based' function in linux. When I run the command from the shell, like so: goset -f ' "%s %s" name addr ' file_name it works fine however when I try to do it in python like so: p = subprocess.Popen(["goest",'-f \'\"%s %s\" name addr\'

problem with single-quote and double-quote when using subprocess.

2008-11-03 Thread Evan
Hello - i'm trying to call subprocess.popen on the 'command-based' function in linux. When I run the command from the shell, like so: goset -f ' "%s %s" name addr ' file_name it works fine however when I try to do it in python like so: p = subprocess.Popen(["goest",'-f \'\"%s %s\" name addr\'

Re: push-style templating - an xml-like way to process xhtml

2008-11-03 Thread has
On 3 Nov 2008, at 18:18, Glenn Linderman wrote: > On approximately 11/3/2008 12:20 AM, came the following characters > from the keyboard of has: >> On 2 Nov, 14:06, Tino Wildenhain <[EMAIL PROTECTED]> wrote: >> >>> "$attr.title$ >>> $if(attr.active)$ >>> $attr.submenu:menuItem()$ >>> $endif$" >>>

Re: Structures

2008-11-03 Thread Paulo J. Matos
On Mon, Nov 3, 2008 at 10:10 PM, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > Ben Finney <[EMAIL PROTECTED]> writes: > >> "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > [...] >> Okay, you're talking about 'struct' from the C language. That helps >> answer the question. > > Note that structs are mu

Re: Structures

2008-11-03 Thread Paulo J. Matos
On Mon, Nov 3, 2008 at 10:19 PM, Aaron Brady <[EMAIL PROTECTED]> wrote: > On Nov 3, 3:45 pm, Ben Finney <[EMAIL PROTECTED]> > wrote: >> "Paulo J. Matos" <[EMAIL PROTECTED]> writes: >> >> > On Mon, Nov 3, 2008 at 12:32 PM, Ben Finney >> > <[EMAIL PROTECTED]> wrote: >> > > I'm wondering a more fundam

Re: Structures

2008-11-03 Thread Joe Strout
On Nov 3, 2008, at 4:38 PM, Paulo J. Matos wrote: However, I wouldn't dare to say Python needs structures to be a good language, or anything similar. My question was more directed to : if there aren't structures in Python, what do Pythonists use instead? Classes. Best, - Joe -- http://mail.

Re: PYTHON WORKING WITH PERL ??

2008-11-03 Thread Craig Allen
> article:http://www.linuxjournal.com/article/3882 interesting read, thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Structures

2008-11-03 Thread Paulo J. Matos
On Mon, Nov 3, 2008 at 11:47 PM, Joe Strout <[EMAIL PROTECTED]> wrote: > On Nov 3, 2008, at 4:38 PM, Paulo J. Matos wrote: > >> However, I wouldn't dare to say Python needs structures to be a good >> language, or anything similar. My question was more directed to : if >> there aren't structures in

Re: PYTHON WORKING WITH PERL ??

2008-11-03 Thread Craig Allen
> article:http://www.linuxjournal.com/article/3882 even if it is by Eric Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with quote and single-quote when using "subprocess"

2008-11-03 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Nov 2008 14:45:22 -0800, Evan wrote: > Hello - > > i'm trying to call subprocess.popen on the 'command-based' function in > linux. When I run the command from the shell, like so: > > goset -f ' "%s %s" name addr ' file_name > > it works fine > > however when I try to do it in pytho

Re: Structures

2008-11-03 Thread George Sakkis
On Nov 3, 6:51 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 11:47 PM, Joe Strout <[EMAIL PROTECTED]> wrote: > > On Nov 3, 2008, at 4:38 PM, Paulo J. Matos wrote: > > >> However, I wouldn't dare to say Python needs structures to be a good > >> language, or anything simila

Re: Structures

2008-11-03 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Nov 2008 23:32:25 +, Paulo J. Matos wrote: > What's then the reason for adding named tuples if they are not > mutable...??? Names are more descriptive than "magic numbers" as indices. See for example the "named tuple" returned by `os.stat()`. Ciao, Marc 'BlackJack' Rints

Re: Structures

2008-11-03 Thread Paulo J. Matos
On Tue, Nov 4, 2008 at 12:17 AM, George Sakkis <[EMAIL PROTECTED]> wrote: > > Technically there are no private attributes in (pure) Python so the > answer is still classes. > OK, so this is now messing with my lack of knowledge regarding Python. What's (pure) Python? Is there any impure Python? >

Re: Finding the instance reference of an object

2008-11-03 Thread Marc 'BlackJack' Rintsch
On Mon, 03 Nov 2008 15:27:01 -0700, Joe Strout wrote: > On Nov 3, 2008, at 2:36 PM, Aaron Brady wrote: >> Python can do the swap operation on mutable types, for example. > > That's in the "no fair" category. C can do a swap operation on mutable > types, too, though it also has only pass-by-value

Re: Structures

2008-11-03 Thread Paul Rubin
"Paulo J. Matos" <[EMAIL PROTECTED]> writes: > OK, so this is now messing with my lack of knowledge regarding Python. > What's (pure) Python? Is there any impure Python? impure Python = Python with extensions written in C. -- http://mail.python.org/mailman/listinfo/python-list

Re: Structures

2008-11-03 Thread George Sakkis
On Nov 3, 6:32 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > Even though I can use dicts where the keys are strings (as if it were > the name of the field), it seems to heavy, since a structure doesn't > need to be resizable (and dicts are) and it has constant time access > (which depending on

Re: problem with single-quote and double-quote when using subprocess.

2008-11-03 Thread alex23
On Nov 4, 8:47 am, Evan <[EMAIL PROTECTED]> wrote: > It always failed. > It also failed. > Does anybody have a good suggestion for this matter? thanks in > advance. What do you mean by "it failed"? It always helps to paste the actual error message you received. -- http://mail.python.org/mailman/li

Re: How do I find the memory used by a python process

2008-11-03 Thread Scott David Daniels
Ben Finney wrote: Salim Fadhley <[EMAIL PROTECTED]> writes: The unit-test needs to check that after the functions have been run a few thousand times all of the memory used by those functions has been un-allocated, i.e. that there are no memory leaks. This is a great test case, However, I

Re: Structures

2008-11-03 Thread Aaron Brady
On Nov 3, 6:33 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Nov 3, 6:32 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > > > Even though I can use dicts where the keys are strings (as if it were > > the name of the field), it seems to heavy, since a structure doesn't > > need to be resizable

Re: Anyone in the Houston / College Station / Austin area? Looking to do some sprints / joint projects.

2008-11-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, xkenneth <[EMAIL PROTECTED]> wrote: >All, > > I'm in Houston/College Station/Austin quite often and I'm looking >for other coders to do some joint projects with, share experiences, or >do some sprints. Let me know if you're interested. .

SQL is many things, but "mini" had never occurred to me as one of them (was: push-style templating - an xml-like way to process xhtml)

2008-11-03 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Tino Wildenhain <[EMAIL PROTECTED]> wrote: . . . >Mini languages is the correct term. And yes they have their >purpose. (Think of SQL for example). .

Re: Structures

2008-11-03 Thread Aaron Brady
On Nov 3, 5:38 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: > On Mon, Nov 3, 2008 at 10:19 PM, Aaron Brady <[EMAIL PROTECTED]> wrote: > > On Nov 3, 3:45 pm, Ben Finney <[EMAIL PROTECTED]> > > wrote: > >> "Paulo J. Matos" <[EMAIL PROTECTED]> writes: > >> Take care with broad sweeping statements a

Re: Structures

2008-11-03 Thread Glenn Linderman
On approximately 11/3/2008 3:38 PM, came the following characters from the keyboard of Paulo J. Matos: On Mon, Nov 3, 2008 at 10:19 PM, Aaron Brady <[EMAIL PROTECTED]> wrote: On Nov 3, 3:45 pm, Ben Finney <[EMAIL PROTECTED]> wrote: "Paulo J. Matos" <[EMAIL PROTECTED]> writes: O

Re: Simple textual calendar

2008-11-03 Thread Mensanator
On Nov 3, 7:31 am, ostra pikula <[EMAIL PROTECTED]> wrote: > On Mon, 03 Nov 2008 14:14:00 +0100, ostra pikula > > > > > > <[EMAIL PROTECTED]> wrote: > >Hello everyone, > > >please, I need your help. I'm a beginner in python and this is > >probably elemental to you, but represents quote a goggle for

Re: Finding the instance reference of an object

2008-11-03 Thread Steven D'Aprano
On Mon, 03 Nov 2008 15:27:01 -0700, Joe Strout wrote: >> By-Value and By-Reference are not the only passing methods. True or >> False? > > True, but the others are rarely used and don't apply to any of the > languages we've been discussing. Yeah, uncommon, rare languages that nobody uses, like

Re: Finding the instance reference of an object

2008-11-03 Thread Joe Strout
On Nov 3, 2008, at 5:27 PM, Marc 'BlackJack' Rintsch wrote: Maybe this is a surprise for you, because we haven't discussed this in much detail in this group lately, but it applies to Python which does call-by-object or call-by-sharing. ;-) There's no such thing. Those are just terms made up

Re: Structures

2008-11-03 Thread Steven D'Aprano
On Mon, 03 Nov 2008 17:06:07 -0800, Aaron Brady wrote: >> For all practical purposes, dicts have almost constant access time (at >> least with any half-decent __hash__  method). > > Hash tables are slick, but their hash function is their weakest link. > [ hash( 2**x ) for x in range( 0, 256

Re: how to call this dll in python

2008-11-03 Thread Shark
On Nov 3, 4:22 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Shark schrieb: > > > I have a windows dll1.dll with a export function: > > > int f1(char filename,char **buf,int *bufLen) > > { > > int len; > > //got the length of file anyway,such as 100 > > len = 100;//len = getLen(filename); > >

Re: Structures

2008-11-03 Thread Steven D'Aprano
On Tue, 04 Nov 2008 00:19:16 +, Marc 'BlackJack' Rintsch wrote: > On Mon, 03 Nov 2008 23:32:25 +, Paulo J. Matos wrote: > >> What's then the reason for adding named tuples if they are not >> mutable...??? > > Names are more descriptive than "magic numbers" as indices. See for > example

Make Money Fast, Guranteed!

2008-11-03 Thread lillylove0826
MAKE MONEY FAST AND EASY HURRY [ Follow Ups ] [ Post Followup ] [ Message Board ] Posted by [IP Address: 12.2.88.76] 'Jed' on March 12, 2001 at 18:15:57 EST: MAKE MONEY FAST AND EASY HURRY Make Money Fast A little while back, I was browsing these newsgroups, just like you are n

locating the chorus in a MIDI song?

2008-11-03 Thread Joe Strout
We've got a need to generate short "samples" of songs that are in MIDI format, to provide a preview function in a web app. We'd like to do something more clever than just taking the middle 20 seconds (or whatever) of the song -- ideally, we'd like to find the chorus, since that's likely to

Re: Finding the instance reference of an object

2008-11-03 Thread Aaron Brady
On Nov 3, 8:33 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Nov 3, 2008, at 5:27 PM, Marc 'BlackJack' Rintsch wrote: > > > Maybe this is a surprise for you, because we haven't discussed this in > > much detail in this group lately, but it applies to Python which does > > call-by-object or call-by

Re: storing a string data in access

2008-11-03 Thread Tim Arnold
"alex23" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Nov 3, 3:47 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> Hi >> I have >> access.Fields("Time").value=t >> I would like t to be a string reprsenting a data. How can I do this? > > t = "string representing a datum" > ac

Jobs vacancies and openings in Asia. Create a more stable financial future by teaching English in Asia. Explore the options of starting a successful new career and lifestyle in Asia.

2008-11-03 Thread Jobs, Work, Teaching English, TEFL, TESOL, Gap Year, Travel, Thailand, Cambodia, Vietnam Languagecorps
Jobs vacancies and openings in Asia. Create a more stable financial future by teaching English in Asia. Explore the options of starting a successful new career and lifestyle in Asia. Teach and travel in Asia. TEFL / TESOL training can give you the international skills you need to teach and trav

Which was the best Lib of GUI for python

2008-11-03 Thread 3000 billg
Hi Guy, I am a leaner. for your experience. Which GUI Lib will be the best for Python? wxpython, Tkinter or... -- http://mail.python.org/mailman/listinfo/python-list

Re: Structures

2008-11-03 Thread Glenn Linderman
On approximately 11/3/2008 5:28 PM, came the following characters from the keyboard of Aaron Brady: On Nov 3, 5:38 pm, "Paulo J. Matos" <[EMAIL PROTECTED]> wrote: On Mon, Nov 3, 2008 at 10:19 PM, Aaron Brady <[EMAIL PROTECTED]> wrote: On Nov 3, 3:45 pm, Ben Finney <[EMAIL PROTECTED]> wr

Re: buffer

2008-11-03 Thread Tim Roberts
"Aditi Meher" <[EMAIL PROTECTED]> wrote: > >i am using it postgresql as back-end and HTML as front-end,i want to, >display 10-10 records at a time which is there in the database using, >python.so what is function for buffer that we can use it in python?i, >am able to connect my databse in python,bu

Re: how to call this dll in python

2008-11-03 Thread Mark Tolonen
"Shark" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a windows dll1.dll with a export function: int f1(char filename,char **buf,int *bufLen) { int len; //got the length of file anyway,such as 100 len = 100;//len = getLen(filename); *buf = (char*)calloc(100); *bufLen = len

Re: redirection in a file with os.system

2008-11-03 Thread [EMAIL PROTECTED]
On Nov 4, 12:06 am, TP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > The following code does not redirect the output of os.system("ls") in a > file: > > import sys, os > saveout = sys.stdout > fd = open( 'toto', 'w' ) > sys.stdout = fd > os.system( "ls" ) > sys.stdout = saveout > fd.close() os.sy

Re: Embedding: Is it possible to limit number of virtual instructions executed?

2008-11-03 Thread juliangrendell
Thanks to those who replied; it seems that it is possible to do, but would require some changes to the python core, and may not be as fine-grained as I'd presumed. I think I'll consider running python in a seperate thread and create a couple of message queues to/from that thread and the main threa

Re: Structures

2008-11-03 Thread Michele Simionato
On Nov 4, 2:57 am, Glenn Linderman <[EMAIL PROTECTED]> wrote: > Note that classes, by default, are based on a contained dict!  There are > games to be played with slots that can apparently improve that.  I am > not yet experienced enough with Python to know if a slot is as fast as a > C struct, but

<    1   2