Re: Little novice program written in Python

2008-04-24 Thread castironpi
On Apr 24, 11:09 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 24 Apr 2008 21:31:15 -0300, Rogério Brito <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > a = [i for i in range(0,n+1)] > >         Uhm... At least in 2.4 and earlier, range() returns a list... No >

Re: diffing and uniqing directories

2008-04-26 Thread castironpi
On Apr 26, 1:14 pm, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > Over years Ive collected tgz's of my directories. I would like to diff > and uniq them > > Now I guess it would be quite simple to write a script that does a > walk or find through a pair of directory trees, makes a SHA1 of each > file

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-26 Thread castironpi
On Apr 26, 5:03 pm, John Henry <[EMAIL PROTECTED]> wrote: > On Apr 26, 8:46 am, [EMAIL PROTECTED] (Aahz) wrote: > > > > > > > In article <[EMAIL PROTECTED]>, > > John Henry  <[EMAIL PROTECTED]> wrote: > > > >But then I looked closer.  It turns out the XML file created by > > >QxTransformer is *very

Re: Why can't timedeltas be divided?

2008-04-26 Thread castironpi
On Apr 26, 10:27 pm, Jon Ribbens <[EMAIL PROTECTED]> wrote: > On 2008-04-27, Martin v. Löwis <[EMAIL PROTECTED]> wrote: > > >> sorry for bringing up such an old thread, but this seems important to me > >> -- up to now, there are thousands [1] of python programs that use > >> hardcoded time calculat

Re: diffing and uniqing directories

2008-04-26 Thread castironpi
On Apr 26, 10:35 pm, rustom <[EMAIL PROTECTED]> wrote: > On Apr 27, 12:31 am, [EMAIL PROTECTED] wrote: > > > > > > > On Apr 26, 1:14 pm, "Rustom Mody" <[EMAIL PROTECTED]> wrote: > > > > Over years Ive collected tgz's of my directories. I would like to diff > > > and uniq them > > > > Now I guess it

Re: problem with listdir

2008-04-27 Thread castironpi
On Apr 27, 1:57 am, David <[EMAIL PROTECTED]> wrote: > On Sat, Apr 26, 2008 at 7:56 PM, jimgardener <[EMAIL PROTECTED]> wrote: > > >  > * Run cmd.exe and see if you can run "dir > > f:\\code\\python\pgmgallery/*.*" > > >  that causes a message 'Invalid switch - "*.*".' > > Probably because on the

Re: Random/anonymous class methods

2008-04-27 Thread castironpi
On Apr 27, 7:11 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote: > philly_bob <[EMAIL PROTECTED]> writes: > > In the sample program below, I want to send a random method to a class > > instance. > > In other words, I don't know which method to send until run-time.  How > > can I send ch, which is my

Re: diffing and uniqing directories

2008-04-27 Thread castironpi
t;> […] > > > If this is an answer to my question I dont understand it! > > castironpi is either a bot or trolling.  Just ignore its posts. > > Ciao, >         Marc 'BlackJack' Rintsch I am a bot or trolling. Bots and bot detectors were the first forms of internet life, you know. -- http://mail.python.org/mailman/listinfo/python-list

Re: So you think PythonCard is old? Here's new wine in an old bottle.

2008-04-27 Thread castironpi
On Apr 26, 11:04 pm, John Henry <[EMAIL PROTECTED]> wrote: > On Apr 26, 3:03 pm, John Henry <[EMAIL PROTECTED]> wrote: > > > > > > > On Apr 26, 8:46 am, [EMAIL PROTECTED] (Aahz) wrote: > > > > In article <[EMAIL PROTECTED]>, > > > John Henry  <[EMAIL PROTECTED]> wrote: > > > > >But then I looked cl

Re: Regular Expression - Matching Multiples of 3 Characters exactly.

2008-04-27 Thread castironpi
On Apr 27, 8:31 pm, blaine <[EMAIL PROTECTED]> wrote: > Hey everyone, >   For the regular expression gurus... > > I'm trying to write a string matching algorithm for genomic > sequences.  I'm pulling out Genes from a large genomic pattern, with > certain start and stop codons on either side.  This

generator functions in another language

2008-05-03 Thread castironpi
I'm actually curious if there's a way to write a generator function (not a generator expression) in C, or what the simplest way to do it is... besides link the Python run-time. -- http://mail.python.org/mailman/listinfo/python-list

Re: Light slices + COW

2008-05-03 Thread castironpi
On May 3, 1:59 pm, [EMAIL PROTECTED] wrote: > Sometimes different languages suggests me ways to cross-pollinate > them. > > (Note: probably someone has already suggested (and even implemented) > the following ideas, but I like to know why they aren't fit for > Python). > > Python generators now all

Re: generator functions in another language

2008-05-04 Thread castironpi
On May 4, 12:21 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 01:08:34 -0300, Marc 'BlackJack' Rintsch <[EMAIL > PROTECTED]> escribió: > > > On Sat, 03 May 2008 16:39:43 -0700, castironpi wrote: > > >> I'm

Re: saving a webpage's links to the hard disk

2008-05-04 Thread castironpi
On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> escribió: > > > Is there a good place to look to see where I can find some code that > > will help me to save webpage's links to the local drive, after I have > > used

Re: Light slices + COW

2008-05-04 Thread castironpi
On May 4, 7:49 am, David <[EMAIL PROTECTED]> wrote: > >  > D compiles to efficient machine code so Python is at a disadvantage > >  > even if you use the same syntax (see my first example). You can make > >  > the Python version faster, but beware of premature optimization. > > >  This time I don't

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 12:28 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Mon, 05 May 2008 00:09:02 -0300, hdante <[EMAIL PROTECTED]> escribió: > > > > > > >  Isn't this guy a bot ? :-) It's learning fast. I believe there is a > > "frame" in C, composed of its stack and globals. For generators in C,

STL multimap

2008-05-05 Thread castironpi
Is multimap just a syntax-checked dictionary of mutable sequences? Is def( a ): a[:]= [x] a trick or part of the language? It looks pretty sharp in variable-width. -- http://mail.python.org/mailman/listinfo/python-list

Re: STL multimap

2008-05-05 Thread castironpi
On May 5, 1:26 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > Hi there.  Maybe a little more context would > help us figure out what you want here... > > On May 5, 1:28 pm, [EMAIL PROTECTED] wrote: > > > Is multimap just a syntax-checked dictionary of mutable sequences? > > I think the equivalent o

Re: STL multimap

2008-05-05 Thread castironpi
On May 5, 6:40 pm, [EMAIL PROTECTED] wrote: > On May 5, 1:26 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > > > > Hi there.  Maybe a little more context would > > help us figure out what you want here... > > > On May 5, 1:28 pm, [EMAIL PROTECTED] wrote: > > > > Is multimap just a syntax-check

Re: generator functions in another language

2008-05-05 Thread castironpi
On May 5, 1:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On May 4, 1:11 pm, [EMAIL PROTECTED] wrote: > > > There is no such thing as a 'frame' per se in C; byte code is > > integral.  As there is no such thing as suspended state without > > frames, and no such thing as generators without

Re: parameters to lambda's executed at run time.

2008-05-06 Thread castironpi
On May 6, 5:17 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > wyleu wrote: > > I'm trying to supply parameters to a function that is called at a > > later time as in the code below: > > > llist = [] > > > for item in range(5): > >     llist.append(lambda: func(item)) > > > def func(item): > >

Re: Generate labels for a multi-level outline

2008-05-06 Thread castironpi
On May 6, 4:43 pm, [EMAIL PROTECTED] wrote: > I need to generate multi-level incrementing labels for an > outline/hierarchy where the string for each level of a label is based on > an incrementing sequence like 1, 2, 3 or A, B, C, or even I, II, III. > For simplicity, assume that each level's label

Re: Reversing a dict?

2008-05-06 Thread castironpi
On May 6, 10:20 am, [EMAIL PROTECTED] wrote: > Hi - further to my earlier query regarding partial matches (which with > all your replies enabled me to advance my understanding, thanks), I > now need to reverse a dict. > > I know how to reverse a list (with the reverse method - very handy), > but it

Re: generator functions in another language

2008-05-06 Thread castironpi
On May 6, 1:00 pm, hdante <[EMAIL PROTECTED]> wrote: > On May 6, 12:28 am, [EMAIL PROTECTED] wrote: > > > > > > > > > There's a process decorator to functions in a module. > > > [supposes] > > > @process > > def datafile( processdict ): > >    processdict.modify( ) > >    op= yield > >    op.call(

Re: STL multimap

2008-05-06 Thread castironpi
On May 6, 10:03 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > I'm having trouble following your discussion > and I suspect you might be a friend of Mark V Cheney. > But I will focus on this one point. > > On May 5, 11:14 pm, [EMAIL PROTECTED] wrote: > > > If recursive generators are really useless

Re: saving a webpage's links to the hard disk

2008-05-07 Thread castironpi
On May 7, 1:40 am, Jetus <[EMAIL PROTECTED]> wrote: > On May 4, 7:22 am, [EMAIL PROTECTED] wrote: > > > > > > > On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > > > > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> escribió: > > > > > Is there a good place to l

Re: Why don't generators execute until first yield?

2008-05-07 Thread castironpi
On May 7, 7:37 am, Marco Mariani <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > Perhaps if you'd copied all of my code (including the decorator that was > > the whole point of it)... > > Sure, I missed the point. Python's > symbols become quoting levels and > mess up messages. > > Anyway, I w

Re: Generate labels for a multi-level outline

2008-05-07 Thread castironpi
''' On May 6, 4:43 pm, [EMAIL PROTECTED] honoring: >>> a.next( ) ( "I", ) >>> a.throw( up ) ( "I", "A" ) >>> a.next( ) ( "I", "B" ) >>> a.next( ) ( "I", "C" ) >>> a.throw( down ) ( "II", ) ''' #funny declaration class up( Exception ): pass class down( Exception ): pass def outline( ): stack=

Re: letter frequency counter / your thoughts..

2008-05-07 Thread castironpi
On May 7, 12:30 pm, Paul Melis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Here is my code for a letter frequency counter.  It seems bloated to > > me and any suggestions of what would be a better way (keep in my mind > > I'm a beginner) would be greatly appreciated.. > > Not bad for

Re: Generate labels for a multi-level outline

2008-05-07 Thread castironpi
On May 7, 9:07 am, [EMAIL PROTECTED] wrote: > ''' > On May 6, 4:43 pm, [EMAIL PROTECTED] honoring: > > >>> a.next( ) > ( "I", ) > >>> a.throw( up ) > ( "I", "A" ) > >>> a.next( ) > ( "I", "B" ) > >>> a.next( ) > ( "I", "C" ) > >>> a.throw( down ) > > ( "II", ) > ''' > > #funny declaration > class u

Re: letter frequency counter / your thoughts..

2008-05-07 Thread castironpi
On May 7, 1:31 pm, "Ian Kelly" <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 11:30 AM, Paul Melis <[EMAIL PROTECTED]> wrote: > >     dic = {} > >     for letter in strng: > >         if letter not in dic: > >             dic[letter] = 0 > >         dic[letter] += 1 > > As a further refinement

Re: howto print binary number

2008-05-07 Thread castironpi
On May 7, 3:31 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On May 7, 3:13 pm, dmitrey <[EMAIL PROTECTED]> wrote: > > > hi all, > > could you inform how to print binary number? > > I.e. something like > > > print '%b' % my_number > > > it would be nice would it print exactly 8 binary digits (0-1, wi

Re: howto print binary number

2008-05-07 Thread castironpi
On May 7, 4:03 pm, Joel Bender <[EMAIL PROTECTED]> wrote: > > Python 3.0 has such a formatting operation, but Python 2.x does not.   > > However it's not hard to write. > > Indeed.  Refraining from using named lambdas: > >      >>> def bin(x): >      ...     return ''.join(x & (1 << i) and '1' or '

Re: letter frequency counter / your thoughts..

2008-05-07 Thread castironpi
On May 7, 5:27 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On 7 mai, 23:51, "[EMAIL PROTECTED]"<[EMAIL PROTECTED]> wrote: > > (snip) > > Small improvement thanks to Paul Rubin: > > from collections import defaultdict > from operator import itemgetter > > def get_letters_frequency(source):

Re: slicing lists

2008-05-07 Thread castironpi
On May 7, 6:58 pm, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Wed, 07 May 2008 23:46:33 +, Ivan Illarionov wrote: > > On Wed, 07 May 2008 23:29:27 +, Yves Dorfsman wrote: > > >> Is there a way to do: > >> x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > >> x[0,2:6] > > >> That would return: > >>

Re: Why don't generators execute until first yield?

2008-05-07 Thread castironpi
On May 7, 4:51 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > Martin Sand Christensen wrote: > > Why don't > > generators follow the usual eager evaluation semantics of Python and > > immediately execute up until right before the first yield instead? > > A great example of why this behavior would

Re: saving a webpage's links to the hard disk

2008-05-07 Thread castironpi
On May 7, 8:36 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jetus wrote: > > On May 4, 7:22 am, [EMAIL PROTECTED] wrote: > >> On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > >> wrote: > > >> > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> > >> > escribió: > > >>

Re: pickle problem

2008-05-07 Thread castironpi
On May 7, 11:02 pm, [EMAIL PROTECTED] wrote: > I'm wondering if anyone can help with a workaround for a problem I > currently have.  I'm trying to set up a prefork tcp server. > Specifically, I'm setting up a server that forks children and has them > listen on pipes created with os.pipe().  The par

Re: Mathematics in Python are not correct

2008-05-08 Thread castironpi
On May 8, 6:10 pm, Nicolas Dandrimont <[EMAIL PROTECTED]> wrote: > * [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2008-05-08 15:54:42 -0700]: > > > Have a look at this: > > > >>> -123**0 > > -1 > > > The result is not correct, because every number (positive or negative) > > raised to the power of 0 is AL

Re: threading - race condition?

2008-05-08 Thread castironpi
On May 8, 5:45 pm, skunkwerk <[EMAIL PROTECTED]> wrote: > i'm getting the wrong output for the 'title' attributes for this > data.  the queue holds a data structure (item name, position, and list > to store results in).  each thread takes in an item name and queries a > database for various attribu

Re: RELEASED Python 2.6a3 and 3.0a5

2008-05-08 Thread castironpi
On May 8, 6:50 pm, Barry Warsaw <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team and the Python community, I   > am happy to announce the third alpha release of Python 2.6, and the   > fifth alpha release of Python 3.0. > > Pl

Re: Python GUIs and custom controls

2008-05-08 Thread castironpi
On May 8, 4:30 pm, "Chuckk Hubbard" <[EMAIL PROTECTED]> wrote: > I likewise don't know enough to compare between toolkits, but another > one to check out might be pygame.  If nothing else, it is meant to be > fast and to handle 3D views. > > -Chuckk > > On Fri, May 9, 2008 at 12:10 AM, Joe P. Cool

Re: Running a python code periodically

2008-05-08 Thread castironpi
On May 8, 3:31 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Maryam Saeedi" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > |I was wondering if you know how can I run a python code once every five > | minutes for a period of time either using python or some other program > like

Re: Python Syntax and misspelled variable and method name checker?

2008-05-08 Thread castironpi
On May 8, 1:06 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > neerashish schrieb: > > > > > Is there a good Python Syntax and mis-spelled variable and method name > > checker available. > > > I have been programming in python for last 6 months and misspelled variables > > and method names have

Re: observer pattern question #1 (reference to subject)

2008-05-08 Thread castironpi
On May 8, 4:57 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Ville M. Vainio wrote: > > in case of stocks, you are probably monitoring several > > stock objects, so the stock should probably pass itself to > > the observer > > OK.  This is related to my question #2 (in a separate > > thread), where I

Re: pickle problem

2008-05-08 Thread castironpi
On May 8, 4:35 pm, Hrvoje Niksic <[EMAIL PROTECTED]> wrote: > Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> writes: > > > On Thu, 08 May 2008 08:55:35 -0700, krustymonkey wrote: > > >> The thing is, I'm not using slots by choice.  I'm using the standard > >> lib "socket" class, which apparently uses

Re: slicing lists

2008-05-09 Thread castironpi
On May 9, 1:23 am, "Ian Kelly" <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 5:29 PM, Yves Dorfsman <[EMAIL PROTECTED]> wrote: > > Is there a way to do: > > x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > > x[0,2:6] > > > That would return: > > [0, 3, 4, 5, 6] > > > I am surprised this notation is not

bytes1.shuffle( )

2008-05-09 Thread castironpi
random.shuffle( bytes1 ) if random == bytes: repunctuate( sentence ) else: random.shuffle( [ random ] ) sincerely exit, () -- http://mail.python.org/mailman/listinfo/python-list

Re: How to modify meaning of builtin function "not" to "!"?

2008-05-09 Thread castironpi
On May 9, 8:41 am, grbgooglefan <[EMAIL PROTECTED]> wrote: > I am creating functions, the return result of which I am using to make > decisions in combined expressions. > In some expressions, I would like to inverse the return result of > function. > > E.g. function contains(source,search) will ret

Re: slicing lists

2008-05-09 Thread castironpi
On May 9, 10:11 am, Yves Dorfsman <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > The only thing is, is there is another natural meaning to [a,b:c]. > > > Counting grids on the diagonals, the rational set is well defined: > > > 0: 0, 0 > > 1: 1, 0 > > 2: 0, 1 > > 3: 2, 0 > > 4: 1, 1 > > 5

Re: RELEASED Python 2.6a3 and 3.0a5

2008-05-09 Thread castironpi
On May 9, 7:55 pm, Stéphane Larouche <[EMAIL PROTECTED]> wrote: > > On 9 Mai, 01:50, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > > On behalf of the Python development team and the Python community, I > > > am happy to announce the third alpha release of Python 2.6, and the > > > fifth alpha release

Python and the Bartender

2008-05-09 Thread castironpi
Incidentally, now that everyone knows English, writer would like to critique his behavior. I have leaned to the group for approval, at times by disparaging the efforts of others, but other times not. I have expressed negative emotion. Is anyone in earshot getting work done that I am interfering

Re: Pythonicity of some algorithms

2008-05-10 Thread castironpi
On May 10, 5:21 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > This works for me. But I'd like to know if this is considered > > Pythonic, and if there are other, better ways of doing the above in > > Python. > > From the Python point of view, it's fine. However, it uses busy-wait, > which I

Re: slicing lists

2008-05-10 Thread castironpi
On May 9, 3:17 pm, [EMAIL PROTECTED] wrote: > On May 9, 10:11 am, Yves Dorfsman <[EMAIL PROTECTED]> wrote: > > > > > > > [EMAIL PROTECTED] wrote: > > > The only thing is, is there is another natural meaning to [a,b:c]. > > > > Counting grids on the diagonals, the rational set is well defined: > > >

Re: People still using Tkinter?

2008-05-10 Thread castironpi
On May 10, 1:38 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 10 May 2008 00:20:33 -0500, Kenneth McDonald wrote: > > Any guesses as to how many people are still using Tkinter? And can   > > anyone direct me to good, current docs for Tkinter? > > AFAIK `Tkinter` hasn't changed m

Now, as for the jokes: Python!

2008-05-10 Thread castironpi
Dear Monty, Grail This. The grail is unarmed and floating. Stop posting the newsgroup. Python is Monty Python. In the sense of identity ascription, of course. Trivially not, A Bartender. -- http://mail.python.org/mailman/listinfo/python-list

Re: Now what!?

2008-05-10 Thread castironpi
On May 10, 10:05 pm, hdante <[EMAIL PROTECTED]> wrote: > On May 10, 8:22 pm, notbob <[EMAIL PROTECTED]> wrote: > > > On 2008-05-10, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > >    So... in short, you'd need to have been reading a tutorial specific > > > to "shell" scripting... > > > I have

Re: People still using Tkinter?

2008-05-10 Thread castironpi
On May 10, 1:57 pm, Kenneth McDonald <[EMAIL PROTECTED]> wrote: > The only trick it that sometimes it isn't obvious how to make the Tcl/ > Tk call via Python. > > Ken > > On May 10, 2008, at 11:27 AM, Martin v. Löwis wrote: > > > > >> I am, but "still" isn't the word, I just started.  Good, *comple

Re: Is using range() in for loops really Pythonic?

2008-05-11 Thread castironpi
On May 11, 12:38 am, Paul Rubin wrote: > John Salerno <[EMAIL PROTECTED]> writes: > > for x in range(10): > >     #do something 10 times > > > is unPythonic. The reason I ask is because the structure of the for loop > > seems to be for iterating through a sequence. It see

Re: negative numbers are not equal...

2008-08-14 Thread castironpi
On Aug 14, 4:31 pm, Wojtek Walczak <[EMAIL PROTECTED]> wrote: > On Thu, 14 Aug 2008 18:23:21 -0300, ariel ledesma wrote: > > i see now, so i guess that's also why id() returns the same address for > > them as well... > > It just have to work like this. > > a is b > > is actually equal to: > > id(a)

Re: a podcast for music algo-comped with python

2008-08-14 Thread castironpi
On Aug 14, 4:01 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 14 Aug, 22:44, '2+ <[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 some tricks t

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 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.

mmap and ctypes

2008-08-16 Thread castironpi
Hi all, I have a mmap and a data structure in it. I know the structure's location in the mmap and what structure it is. It has a ctypes definition. I want to initialize a ctypes object to point to a part of the mmap. Here is my attempt: >>> b >>> c= ctypes.pointer( b ) Traceback (most recent

Re: mmap and ctypes

2008-08-16 Thread castironpi
On Aug 16, 4:42 pm, "Michel Claveau - NoSpam SVP ; merci" <[EMAIL PROTECTED]> wrote: > Hi! > > I use mmap for interchange data between Python & Autoit.  For that, I > use (Autoit's side) a little DLL. > This DLL can, perhaps, be used with ctypes. > > @-salutations > -- > Michel Claveau Say more-

Re: mmap and ctypes

2008-08-16 Thread castironpi
On Aug 16, 5:20 pm, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 16, 4:42 pm, "Michel Claveau - NoSpam SVP ; merci" > > <[EMAIL PROTECTED]> wrote: > > Hi! > > > I use mmap for interchange data between Python & Autoit.  For that, I >

dynamic attribute syntax

2008-08-17 Thread castironpi
Hi all, Thinking of a syntax for 'getattr' and 'setattr' dynamic access. 'obj.prop' has an easy access, but att= 'prop' getattr( obj, att ) is much clumsier, while no less useful, maybe more. What are the changes, pros and cons, involved in something like: obj:att for a dynamic access, and obj

Re: dynamic attribute syntax

2008-08-17 Thread castironpi
On Aug 17, 2:46 pm, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 17 Aug, 21:29, castironpi <[EMAIL PROTECTED]> wrote: > > > > > What are the changes, pros and cons, involved in something like: > > > obj:att for a dynamic access, and obj.att for static? > &

Re: dynamic attribute syntax

2008-08-17 Thread castironpi
On Aug 17, 3:05 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > castironpi wrote: > > 'obj.prop' has an easy access, but > > > att= 'prop' > > getattr( obj, att ) > > > is much clumsier, while no less useful, maybe more. > >

Re: getattr() on nested functions?

2008-08-21 Thread castironpi
On Aug 21, 10:14 am, Bruno Desthuilliers wrote: > Gabriel Rossetti a écrit : > > > > > Bruno Desthuilliers wrote: > >> Gabriel Rossetti a écrit : > >>> Terry Reedy wrote: > >> (snip) > Unlike the class approach, this requires recreating the constant > functions and dict with each call to

Re: mmap and ctypes

2008-08-21 Thread castironpi
On Aug 18, 1:09 am, "Méta-MCI \(MVP\)" <[EMAIL PROTECTED]> wrote: > Hi! > > See here: >  http://www.ponx.org/download/CD/COMdll/autoitmmap.dll > > @-salutations > -- > Michel Claveau I don't see how it fits in. -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorators using instance variables

2008-08-21 Thread castironpi
On Aug 21, 9:22 pm, robert2821 <[EMAIL PROTECTED]> wrote: > Hi, > > I'm new; greetings all! > > I'm wondering if the following program should work.  I think it should > print 'Hello, World', but instead it produces a TypeError.  Is this a > bug in decorators, a feature of them, or a mistake or misu

Address-Of operator equivalent, PAVL search tree

2008-08-21 Thread castironpi
Hi, I am translating the GNU library's PAVL search tree implementation into Python. I can't use it directly because a delete function I need uses a different method of finding the node to delete. It contains this line: q = (struct pavl_node *) &tree->pavl_root; line 276 in http://www.sf

Re: Address-Of operator equivalent, PAVL search tree

2008-08-21 Thread castironpi
On Aug 21, 11:03 pm, castironpi <[EMAIL PROTECTED]> wrote: > Hi, > > I am translating the GNU library's PAVL search tree implementation > into Python.  I can't use it directly because a delete function I need > uses a different method of finding the node to de

Re: property() usage - is this as good as it gets?

2008-08-22 Thread castironpi
On Aug 22, 11:18 am, David Moss <[EMAIL PROTECTED]> wrote: > Hi, > > I want to manage and control access to several important attributes in > a class and override the behaviour of some of them in various > subclasses. > > Below is a stripped version of how I've implemented this in my current > bit

Re: Should Python raise a warning for mutable default arguments?

2008-08-22 Thread castironpi
On Aug 22, 9:42 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Sometimes it seems that barely a day goes by without some newbie, or not- > so-newbie, getting confused by the behaviour of functions with mutable > default arguments. No sooner does one thread finally, and painfull

Re: pickle passing client/server design

2008-08-22 Thread castironpi
On Aug 22, 12:09 pm, DwBear75 <[EMAIL PROTECTED]> wrote: > I am contemplating the need for a way to handle high speed data > passing between two processes. One process would act as a queue that > would 'buffer' data coming from another processes. Seems that the > easiest way to handle the data woul

In-place memory manager, mmap (was: Fastest way to store ints and floats on disk)

2008-08-22 Thread castironpi
Hi, I've got an "in-place" memory manager that uses a disk-backed memory- mapped buffer. Among its possibilities are: storing variable-length strings and structures for persistence and interprocess communication with mmap. It allocates segments of a generic buffer by length and returns an offset

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread castironpi
On Aug 23, 9:40 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Aug 23, 4:09 am, Steven D'Aprano <[EMAIL PROTECTED] > > > > cybersource.com.au> wrote: > > On Fri, 22 Aug 2008 20:37:09 -0700, Carl Banks wrote: > > > On Aug 22, 10:42 am, Steven D'Aprano <[EMAIL PROTECTED] > > > cybersource.com.au> wro

ctypes initializer

2008-08-23 Thread castironpi
Is there a way to initialize a ctypes Structure to point to an offset into a buffer? I don't know if the way I'm doing it is supported. -- http://mail.python.org/mailman/listinfo/python-list

Re: ctypes initializer

2008-08-23 Thread castironpi
On Aug 23, 6:43 pm, [EMAIL PROTECTED] wrote: > castironpi napisa³(a): > > > Is there a way to initialize a ctypes Structure to point to an offset > > into a buffer? I don't know if the way I'm doing it is supported. > > There is a high probability you&#x

Re: A variables variables

2008-08-23 Thread castironpi
On Aug 23, 7:25 pm, Gandalf <[EMAIL PROTECTED]> wrote: > how can I declare a variable with another variable  name? > > for example  I will use PHP: > > $a= "hello"; > > $a_hello="baybay"; > > print ${'a_'.$a)  //output: baybay > > how can i do it with no Arrays using  python > > thanks! Here's one

Re: Should Python raise a warning for mutable default arguments?

2008-08-23 Thread castironpi
On Aug 23, 2:57 pm, Cousin Stanley <[EMAIL PROTECTED]> wrote: > > Question: what is real warning? > >   Don't  MAKE ME  have to tell you  AGAIN > > -- > Stanley C. Kitching > Human Being > Phoenix, Arizona Two black eyes. Haa haa. My question comes from: "less likely to notice if a real war

Re: property() usage - is this as good as it gets?

2008-08-23 Thread castironpi
On Aug 22, 11:18 am, David Moss <[EMAIL PROTECTED]> wrote: > Hi, > > I want to manage and control access to several important attributes in > a class and override the behaviour of some of them in various > subclasses. > > Below is a stripped version of how I've implemented this in my current > bit

Re: two's complement bytes

2008-08-23 Thread castironpi
On Aug 23, 10:51 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > I'm dabbling with AVR's for a project I have and that means I have to > use C (ageist my will).  Because my AVR will be tethered to my laptop, > I am writing most of my logic in python, in the hopes of using at > little C as possible. > >

Re: two's complement bytes

2008-08-23 Thread castironpi
On Aug 23, 11:52 pm, "Adam W." <[EMAIL PROTECTED]> wrote: > On Aug 24, 12:23 am, castironpi <[EMAIL PROTECTED]> wrote: > > > Try this out.  Does it come close to what you want? > > > import struct > > struct.pack( 'i', ~10

Re: property() usage - is this as good as it gets?

2008-08-24 Thread castironpi
On Aug 24, 5:00 am, alex23 <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > and we'll write Python. > > I haven't seen anything you've contributed to this group that would so > far be considered well-written Python. > > Conf

Re: What is class method?

2008-08-24 Thread castironpi
On Aug 24, 3:35 am, MeTheGameMakingGuy <[EMAIL PROTECTED]> wrote: > On Aug 24, 6:32 pm, Hussein B <[EMAIL PROTECTED]> wrote: > > > Hi, > > I'm familiar with static method concept, but what is the class method? > > how it does differ from static method? when to use it? > > -- > > class M: > >  def m

Re: Best way to set/get an object property

2008-08-24 Thread castironpi
On Aug 24, 5:07 am, Hussein B <[EMAIL PROTECTED]> wrote: > Hey, > I noted that Python encourage the usage of: > -- > obj.prop = data > x = obj.prop > -- > to set/get an object's property value. > What if I want to run some logic upon setting/getting a property? > What is Python preferred method to

Re: ctypes initializer

2008-08-24 Thread castironpi
On Aug 23, 7:11 pm, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 23, 6:43 pm, [EMAIL PROTECTED] wrote: > > > > > castironpi napisa³(a): > > > > Is there a way to initialize a ctypes Structure to point to an offset > > > into a buffer? I do

Re: recursively change values in list of lists

2008-08-24 Thread castironpi
On Aug 24, 9:17 am, "Carson Farmer" <[EMAIL PROTECTED]> wrote: > Dear list, > > I'm sure this is a relatively trivial problem, but I have been unable > to find any good examples/explanations on how to do this, so here > goes: > > I have multi-polygon object, which is simply a list of polygons, wher

Re: In-place memory manager, mmap (was: Fastest way to store ints and floats on disk)

2008-08-24 Thread castironpi
On Aug 24, 9:52 am, Kris Kennaway <[EMAIL PROTECTED]> wrote: > castironpi wrote: > > Hi, > > > I've got an "in-place" memory manager that uses a disk-backed memory- > > mapped buffer.  Among its possibilities are: storing variable-length > > stri

Re: In-place memory manager, mmap

2008-08-24 Thread castironpi
On Aug 24, 12:19 pm, Kris Kennaway <[EMAIL PROTECTED]> wrote: > castironpi wrote: > > On Aug 24, 9:52 am, Kris Kennaway <[EMAIL PROTECTED]> wrote: > >> castironpi wrote: > >>> Hi, > >>> I've got an "in-place" memory ma

Re: property() usage - is this as good as it gets?

2008-08-24 Thread castironpi
On Aug 24, 7:43 pm, alex23 <[EMAIL PROTECTED]> wrote: > castironpi <[EMAIL PROTECTED]> wrote: > > Python isn't as clever as you think.  It's a language.   > > Yet another non-sequitur response from you. At which point in my post > did I make any such clai

Re: property() usage - is this as good as it gets?

2008-08-24 Thread castironpi
On Aug 24, 10:41 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Aug 25, 12:42 pm, castironpi <[EMAIL PROTECTED]> wrote: > > > I'm baffled.  I don't understand what you write.   > > Which is pretty much how I feel about -all- of your posts. Alright. You're

Re: Private attribute

2008-08-25 Thread castironpi
On Aug 25, 2:09 pm, Ken Starks <[EMAIL PROTECTED]> wrote: > Ken Starks wrote: > > I have a class with an attribute called 'gridsize' and I want > > a derived class to force and keep it at 0.8 (representing 8mm). > > > Is this a correct, or the most pythonic approach? > > > > >

Struct class random access

2008-08-25 Thread castironpi
struct.Struct lets you encode Python objects into structured memory. It accepts a format string, and optionally a buffer and offset to/from which to read/write the structure. What do you think of random access for the results? (unproduced) >>> packer= struct.Struct( 'IIIf255p' ) >>> packer.pack_i

Re: Struct class random access

2008-08-25 Thread castironpi
On Aug 25, 4:25 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Mon, 25 Aug 2008 13:03:09 -0700, castironpi wrote: > > struct.Struct lets you encode Python objects into structured memory. It > > accepts a format string, and optionally a buffer and o

Re: Struct class random access

2008-08-25 Thread castironpi
On Aug 25, 4:49 pm, castironpi <[EMAIL PROTECTED]> wrote: > On Aug 25, 4:25 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > > > On Mon, 25 Aug 2008 13:03:09 -0700, castironpi wrote: > > > struct.Struct lets you encode Python objects

Re: Return a string result with out breaking loop

2008-08-25 Thread castironpi
On Aug 25, 6:37 pm, Andrew <[EMAIL PROTECTED]> wrote: > Hi I was wondering if there is anyway with XML RPC to send a string of > text from the server to the client with out calling return thus breaking >   my loop > > for example > >   def somefunc(): >        for action, files in results: >      

<    3   4   5   6   7   8   9   10   11   >