Re: Getting elements and text with lxml

2008-05-17 Thread J . Pablo Fernández
On May 17, 4:17 pm, Stefan Behnel <[EMAIL PROTECTED]> wrote: > J. Pablo Fernández wrote: > > I have an XML file that starts with: > > > > > > > > >   *-a > > > > > out of it, I'd like to extract something like (I'm just showi

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

Checking the coding style

2010-02-07 Thread Pablo Recio Quijano
oding standars [2] and it's very usefull to clean the code. Thanks in advance! [1] http://www.python.org/dev/peps/pep-0008/ [2] http://drupal.org/coding-standards -- Pablo Recio Quijano Estudiante de Ingeniería Informática (UCA) Alumno colaborador del Departamento de Lenguajes y Sistemas In

Re: Checking the coding style

2010-02-07 Thread Pablo Recio Quijano
Thanks! Pylint was what i was loking for 2010/2/7 Gerald Britton > pylint and pychecker are good options > > On Sun, Feb 7, 2010 at 1:36 PM, Pablo Recio Quijano > wrote: > > Hi! > > I'm finishing a project writen in Python, and I realize about the > document &

Re: How to add a library path to pythonpath ?

2010-03-16 Thread Pablo Recio Quijano
ib', > 'C:\\WINDOWS\\system32\\python26.zip', 'c:\\Python26\\DLLs', > 'c:\\Python26\\lib', 'c:\\Python26\\lib\\plat-win', > 'c:\\Python26\\lib\\lib-tk', 'c:\\Python26', > 'c:\\Python26\\lib\\site-packages', >

Re: Recommend Commercial graphing library

2010-04-06 Thread Pablo Recio Quijano
ny suggestions / pointers to something useful, > > thanks, > > Matt. > -- > http://mail.python.org/mailman/listinfo/python-list > -- Pablo Recio Quijano Estudiante de Ingeniería Informática (UCA) Alumno colaborador del Departamento de Lenguajes y Sistemas Informáticos Par

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: 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: 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.
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-03 Thread Pablo Torres N.
icial, so it can be judged objectively. -- 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: 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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: binary literal

2009-07-22 Thread Pablo Martí Gamboa
g. > 00101101 instead of 45) ? (Python 3) >>> bin(45) '0b101101' >>> int(_, 2) 45 -- Pablo Martí http://www.linkedin.com/in/pmarti || http://www.warp.es python -c "print '706d6172746940776172702e6573'.decode('hex')" -- 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 >

Data files with distutils and special paths

2010-10-20 Thread Pablo Recio Quijano
'm missing? Regards, [1] http://docs.python.org/distutils/setupscript.html#installing-package-data [2] http://docs.python.org/install/#alternate-installation-unix-the-prefix-scheme -- Pablo Recio Quijano Desarrollador Django Yaco Sistemas - http://www.yaco.es/ -- http://mail.python.org/mailman/listinfo/python-list

Python Bluetooth

2011-06-26 Thread Valentin de Pablo Fouce
Hi all, I'm looking for developing a bluetooth application in python, and I'm looking for the most suitable python library for it. Googling some time I found pyBluez (http://code.google.com/p/pybluez/), however, the library seems to be stopped since end 2009 (latest update Nov 2009) and not to man

What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
s you like that addresses the following issue: What is the best way to use the dynamic features of Python to avoid having to write a poor's man type system? Thanks! Juan Pablo -- https://mail.python.org/mailman/listinfo/python-list

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 12:06 GMT-07:00 Paul Rubin : > Juan Pablo Romero Méndez writes: > > In online forums sometimes people complain that they end up having to > > test constantly for None > > That's something of a style issue. You can code in a way that avoids a > lot of

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
What static checking can actually guarantee varies depending on the specific type system at hand (C# vs Haskell vs Idris for example). But most of them can guarantee simple stuff like: "I'm I allowed to invoke this function at this point?" If you don't have that, well you can rely on tests to show

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 13:18 GMT-07:00 Rob Gaddi : > Juan Pablo Romero Méndez wrote: > > > 2016-08-09 12:06 GMT-07:00 Paul Rubin : > > > >> Juan Pablo Romero Méndez writes: > >> > In online forums sometimes people complain that they end up having to > >> >

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 14:01 GMT-07:00 Michael Selik : > On Tue, Aug 9, 2016 at 3:22 PM Juan Pablo Romero Méndez < > jpablo.rom...@gmail.com> wrote: > >> I'm actually looking for ways to minimize run time errors, so that would >> include TypeError and AttributeError. >>

Re: What's the best way to minimize the need of run time checks?

2016-08-09 Thread Juan Pablo Romero Méndez
2016-08-09 18:28 GMT-07:00 Steven D'Aprano : > On Wed, 10 Aug 2016 04:29 am, Juan Pablo Romero Méndez wrote: > > > Hello, > > > > In online forums sometimes people complain that they end up having to > test > > constantly for None, > > Then don'

Re: What's the best way to minimize the need of run time checks?

2016-08-10 Thread Juan Pablo Romero Méndez
2016-08-09 23:47 GMT-07:00 Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info>: > On Wednesday 10 August 2016 15:20, Juan Pablo Romero Méndez wrote: > > > Ok, so you suggested 1) catching exceptions at the point where you care, > 2) > > preemptively check f

Re: What's the best way to minimize the need of run time checks?

2016-08-10 Thread Juan Pablo Romero Méndez
2016-08-09 23:16 GMT-07:00 Gregory Ewing : > Juan Pablo Romero Méndez wrote: > > This is interesting. You are Ok having runtime errors? >> > > You're going to have runtime errors in any case, whether > they come from code you've put there yourself to check >

Re: What's the best way to minimize the need of run time checks?

2016-08-10 Thread Juan Pablo Romero Méndez
2016-08-09 18:28 GMT-07:00 Steven D'Aprano : > On Wed, 10 Aug 2016 04:29 am, Juan Pablo Romero Méndez wrote: > > > Hello, > > > > In online forums sometimes people complain that they end up having to > test > > constantly for None, > > Then don'

Re: What's the best way to minimize the need of run time checks?

2016-08-10 Thread Juan Pablo Romero Méndez
atures of some language are a better solution than static typing. This is of course more useful in languages that support both paradigms. Juan Pablo 2016-08-10 13:50 GMT-07:00 Michael Selik : > > > On Wed, Aug 10, 2016, 4:34 PM Juan Pablo Romero Méndez < > jpablo.rom...@gmail.com>

Re: What's the best way to minimize the need of run time checks?

2016-08-12 Thread Juan Pablo Romero Méndez
2016-08-12 1:10 GMT-07:00 Lawrence D’Oliveiro : > On Thursday, August 11, 2016 at 8:33:41 AM UTC+12, Juan Pablo Romero > Méndez wrote: > > > I've been trying to find (without success so far) an example of a > situation > > where the dynamic features of a language

Re: What's the best way to minimize the need of run time checks?

2016-08-27 Thread Juan Pablo Romero Méndez
2016-08-14 7:29 GMT-07:00 Steven D'Aprano : > On Thu, 11 Aug 2016 06:33 am, Juan Pablo Romero Méndez wrote: > > > I've been trying to find (without success so far) an example of a > > situation where the dynamic features of a language like Python provides a > > c

Re: What's the best way to minimize the need of run time checks?

2016-08-27 Thread Juan Pablo Romero Méndez
2016-08-27 21:30 GMT-07:00 Steve D'Aprano : > On Sun, 28 Aug 2016 12:31 pm, Juan Pablo Romero Méndez wrote: > > > 2016-08-14 7:29 GMT-07:00 Steven D'Aprano : > > > >> On Thu, 11 Aug 2016 06:33 am, Juan Pablo Romero Méndez wrote: > >> > >>

Re: What's the best way to minimize the need of run time checks?

2016-08-27 Thread Juan Pablo Romero Méndez
2016-08-27 21:30 GMT-07:00 Steve D'Aprano : > On Sun, 28 Aug 2016 12:31 pm, Juan Pablo Romero Méndez wrote: > > > 2016-08-14 7:29 GMT-07:00 Steven D'Aprano : > > > >> On Thu, 11 Aug 2016 06:33 am, Juan Pablo Romero Méndez wrote: > >> > >>

Re: What's the best way to minimize the need of run time checks?

2016-08-28 Thread Juan Pablo Romero Méndez
2016-08-28 0:04 GMT-07:00 Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info>: > On Sunday 28 August 2016 15:56, Juan Pablo Romero Méndez wrote: > > > 2016-08-27 21:30 GMT-07:00 Steve D'Aprano : > [...] > >> Now it is true that speaking in full

What do you guys think about adding a method "to_json"

2011-09-11 Thread Juan Pablo Romero Méndez
Hello, What do you guys think about adding a method "to_json" to dictionaries and sequence types? Perhaps through a module import? Regards, Juan Pablo -- http://mail.python.org/mailman/listinfo/python-list

Compiling and installing python 2.5.2 with Visual C++ 2008

2008-12-09 Thread Juan Pablo Romero Méndez
s? Regards, Juan Pablo -- http://mail.python.org/mailman/listinfo/python-list

Re: Compiling and installing python 2.5.2 with Visual C++ 2008

2008-12-09 Thread Juan Pablo Romero Méndez
I've been compiling everything needed by pivy (Coin, Qt, SoQt, PyQt) with visual c++ 8, I decided to recompile python itself. Juan Pablo 2008/12/9 Gabriel Genellina <[EMAIL PROTECTED]>: > En Tue, 09 Dec 2008 11:32:46 -0200, Juan Pablo Romero Méndez > <[EMAIL PROTECTED]&

Re: Mathematica 7 compares to other languages

2008-12-10 Thread Juan Pablo Romero Méndez
In R: norm = function(v) v/sqrt(sum(v^2)) :) Juan Pablo 2008/12/10 Arnaud Delobelle <[EMAIL PROTECTED]>: > "Dotan Cohen" <[EMAIL PROTECTED]> writes: > >> 2008/12/10 <[EMAIL PROTECTED]>: >>> On Dec 5, 9:51 am, Xah Lee <[EMAIL PROTECTE

Re: Compiling and installing python 2.5.2 with Visual C++ 2008

2008-12-10 Thread Juan Pablo Romero Méndez
Finally installed Python 2.6, which is compiled with visual C++ 2008, and all my problems went away. Thanks to all, Juan Pablo 2008/12/10 "Martin v. Löwis" <[EMAIL PROTECTED]>: >> - >> ... >> error: P

eval() and global variables

2008-12-16 Thread Juan Pablo Romero Méndez
f g(k): return f g(1)(1,1) ==> 3 Regards, Juan Pablo -- http://mail.python.org/mailman/listinfo/python-list

Re: eval() and global variables

2008-12-16 Thread Juan Pablo Romero Méndez
* x**2 - v * y**2 ) ) ... and have the code automatically figure out that w and v are free variables and generate the right code. Right now I can catch w and v (using NameError), but can't figure out how to get python to assign values to w and v (other than declaring them globals). My code nee

Re: eval() and global variables

2008-12-18 Thread Juan Pablo Romero Méndez
t;", line 1, in File "", line 4, in TypeError: arg 5 (closure) must be tuple >>> Strange... 2008/12/17 Peter Otten <__pete...@web.de>: > Juan Pablo Romero Méndez wrote: > >> Suppose this function is given: >> >> def f(x,y): >

File transfer with python

2010-01-06 Thread Valentin de Pablo Fouce
Hi there, I hope this is the rigth place, if not please, tell me which is the right dicussion place. I apologize in such case. Ok, I am trying to do a very quick application (is "home based" so is not a big deal...). My intention is to transfer files from one computer to another. I am using seve

Re: Developing GUI applications

2009-06-20 Thread Juan Pablo Romero Méndez
PyQt: http://www.riverbankcomputing.co.uk/software/pyqt/intro All the benefits of Qt: multiplataform, excellent documentation, great API, visual widget designer, etc, etc. For the coding itself, I use netbeans + python plugin. Regards, Juan Pablo 2009/6/21 Chris Rebert : > On Sat, Jun

Re: PyQt GUI

2009-07-08 Thread Juan Pablo Romero Méndez
I use OpenInventor (Coin3d) which have a python binding called "pivy". It works great. http://pivy.coin3d.org/ Juan Pablo 2009/7/8 Helvin : > Hi experts! > > I'm developing a GUI for a software using PyQT, and need 3D > visualization. Should I use PyOpenGL or VTK? &

<    1   2