Commands for a breakpoint in .pdbrc

2010-01-05 Thread Pablo Torres N.
27;foo.attr2' and even 'end'. The same happens for the rest of the breakpoints, so I end up with them set but not their commands. What would be the correct way to do this? Is it even possible? Thanks a lot, Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: easy question, how to double a variable

2009-09-24 Thread Pablo Torres N.
On Sep 24, 5:51 am, Iain King wrote: > On Sep 23, 7:36 pm, David C Ullrich wrote: > > > > > On Tue, 22 Sep 2009 02:34:53 +, Steven D'Aprano wrote: > > > On Mon, 21 Sep 2009 13:50:23 -0500, David C Ullrich wrote: > > > >> But you actually want to return twice the value. I don't see how to do >

Re: How to check if any item from a list of strings is in a big string?

2009-07-16 Thread Pablo Torres N.
turn False > ... >> Any ideas how to make that function look nicer? :) > > Change the names. Reverse the order of the arguments. Add a docstring. > Why reverse the order of the arguments? Is there a design principle there? I always make a mess out of the order of my arguments

Re: Why does extend() fail in this case, and what am I doing wrong?

2009-07-14 Thread Pablo Torres N.
g-Yun "Xavier" Ho, Technical Artist > > Contact Information > Mobile: (+61) 04 3335 4748 > Skype ID: SpaXe85 > Email: cont...@xavierho.com > Website: http://xavierho.com/ > > -- > http://mail.python.org/mailman/listinfo/python-list > > -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: can i write a assemly language programs in python

2009-07-09 Thread Pablo Torres N.
te assembly *with* python. > Or how to translate python to assembly. > > As it turns out, CPython translates Python to byte code and has a dis > (assembly) module that produces very nice assembly code ;-) > So that is one answer to his question. > >> You'll need to tell

Re: Best way to add a "position" value to each item in a list

2009-07-09 Thread Pablo Torres N.
nd what you mean by 'page'. Could you tell us about the structure of these dictionaries? > Any way to do that with list comprehension?  Any other good way to do > it besides iterating over the list? > > Thanks > -- > http://mail.python.org/mailman/listinfo/python-list > -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie needs help

2009-07-07 Thread Pablo Torres N.
> nacim Give this one a try too: http://www.mikeash.com/getting_answers.html It doesn't talk down to you...as much :P -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Semi-Newbie needs a little help

2009-07-06 Thread Pablo Torres N.
tion errors and moving your comments above the line they reference will attract more help from others in this list ;-) Also, I'd recommend limiting your line length to 80 chars, since lines are wrapped anyway. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: A Bug By Any Other Name ...

2009-07-06 Thread Pablo Torres N.
 I agree that it would be a good idea to make it an > error, or a warning - "this might not do what you > think it does", or an "are you sure?" exception. > >  :-) > > - Hendrik That would be even harder than adding a line to the docs. Besides, the problem th

Re: How Python Implements "long integer"?

2009-07-05 Thread Pablo Torres N.
reading this file? I mean which function is the >> first? > > I don't really understand the question:  what do you mean by 'first'? > It might help if you tell us what your aims are. I think he means the entry point, problem is that libraries have many. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Pablo Torres N.
t save your student's sanity and stick to good old conditionals :-) As for your initial question, I think, thirty four emails after, that yes, your function is a bit too clever and you should sacrifice some generality in order to make it more readable. -- Pablo Torres N. -- http://mail.p

Re: Clarity vs. code reuse/generality

2009-07-04 Thread Pablo Torres N.
nd would > like to understand the reasoning behind it. > > kj > -- > http://mail.python.org/mailman/listinfo/python-list > But...if no code is generated for assertions on some occasions, then the parameters would go unchecked, potentially breaking your code in said occasions. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling C or C++ Functions inside Python script

2009-07-04 Thread Pablo Torres N.
ware development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby. " --- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Pablo Torres N.
the last one. In fact, I'd let them to realize that a function is convenient, and base some of the grading in whether they wrote it or not. Just a thought. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-03 Thread Pablo Torres N.
icial, so it can be judged objectively. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
filter are faster than iterating with the for statement (and also faster than list comprehensions). So here is a rewrite: def split(seq, func=bool): t = filter(func, seq) f = filter(lambda x: not func(x), seq) return list(t), list(f) The lambda thing is kinda ugly, but I can't think of anything else. Also, is it ok to return lists? Py3k saw a lot of APIs changed to return iterables instead of lists, so maybe my function should have 'return t, f' as it's last statement. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
On Jul 2, 9:56 pm, schickb wrote: > I have fairly often found the need to split a sequence into two groups > based on a function result. Much like the existing filter function, > but returning a tuple of true, false sequences. In Python, something > like: > > def split(seq, func=None): >     if fu

Re: Sequence splitting

2009-07-02 Thread Pablo Torres N.
ds like it belongs to the python-ideas list. I suggest posting there for better feedback, since the core developers check that list more often than this one. -- Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: problem installing python 2.6.2 from tarball

2009-07-01 Thread Pablo Torres N.
list from a while ago: http://mail.python.org/pipermail/python-list/2004-December/296269.html I have followed it and it worked. Pablo Torres N. -- http://mail.python.org/mailman/listinfo/python-list

Re: Any advice on ways for sharing a small Python application with the world?

2007-08-20 Thread Pablo Torres
On Aug 20, 4:59 pm, Bert Heymans <[EMAIL PROTECTED]> wrote: > Hi, > > I made a Python cli application for resizing batches of images based > on the PIL. You can find it herehttp://heymans.org/pyresize.html > > It's just an straight forward command line interface application but I > guess many peopl

Re: Python question (PyNoob)

2007-08-19 Thread Pablo Torres
On Aug 19, 7:33 pm, Anonymous <[EMAIL PROTECTED]> wrote: > I have exp with C/C++ (and a few other langs). I want to use Python to > start doing the ff: > > 1). Data Munging (text processing) - instead of Perl > 2). Automating my build process > 3). (Possibly) some web data retrieval jobs > > Can an

Re: Syntax Question - list multiplication

2007-08-19 Thread Pablo Torres
Thanks everyone. Now I see why every row in my grid were actually the same object. Pablo -- http://mail.python.org/mailman/listinfo/python-list

Syntax Question - list multiplication

2007-08-19 Thread Pablo Torres
Hi guys! I am working on Conway's Game of Life right now and I've run into a little problem. I represent dead cells with 0s and live ones with 1s. Check this out: >>> grid = [[0] * 3] * 3 >>> grid [[0, 0, 0], [0, 0, 0], [0, 0, 0]] >>> grid[0][0] = 1 [[1, 0,

Re: Permutations with generators

2007-07-20 Thread Pablo Torres
> > list.insert returns None. Thus, except in the one-element case, your > generator is yielding None all the time. > Oh god...silly me. Thank you guys for the help :) P.S I'm dead stubborn, so here's what I did to fix my code: def perm(seq): "Reshuffles the elements of seq in every pos

Re: Permutations with generators

2007-07-20 Thread Pablo Torres
Just a quick P.S: This WOULD NOT work with strings, because of seq.insert() In very other aspect, I'm still lost. -- http://mail.python.org/mailman/listinfo/python-list

Permutations with generators

2007-07-20 Thread Pablo Torres
Hey guys! For the last couple of days, I've been fighting a war against generators and they've beaten the crap out of me several times. What I want to do is implement one that yields every possible permutation of a given sequence (I had lists in mind, but I could swear that this would work on strin