Re: How to find the present working directory using python.

2007-05-04 Thread Isaac Rodriguez
how to find out the present working directory using python. Try this: import os os.getcwd() It returns the current working directory. Thanks, - Isaac. -- http://mail.python.org/mailman/listinfo/python-list

Re: My Python annoyances

2007-04-30 Thread Isaac Rodriguez
Hmm, on my PyCon mug there are words Python: so easy...even your BOSS can use it! Oh man! I would've killed for a mug like that a year ago. I was working for this guy, who had the entire build process automated in .BAT scripts. We spent more time fixing the build process than devoloping our

Re: Calling private base methods

2007-04-19 Thread Isaac Rodriguez
You appear to have led a very sheltered life if the only libraries you ever use are ones where you can always get a change to the library api in a timely manner. The thing here is that we are not talking about my life. I may not have expressed my self correctly, but you are not understanding

Re: Calling private base methods

2007-04-18 Thread Isaac Rodriguez
C++'s and Java's approaches are vitiated by an unspoken assumption that the library's designer is some kind of demigod, while the writer of code that uses the library is presumably still struggling with the challenge of opposable thumbs. That might be your point of view. To me, the

Re: What makes an iterator an iterator?

2007-04-18 Thread Isaac Rodriguez
class Parrot(object): def __iter__(self): return self def __init__(self): Typo right here self.next = self._next() write: self.next = self._next no parenthesis. def _next(self): for word in Norwegian Blue's have beautiful

Re: What makes an iterator an iterator?

2007-04-18 Thread Isaac Rodriguez
Sorry, my previous post was incomplete. I didn't realized that you implemented _next() as a generator funcition. Besides changing __init__() from self.next = self._next() to self.next = self._next you need to implement __iter__() as: return self.next() class Parrot(object):

Re: Calling private base methods

2007-04-18 Thread Isaac Rodriguez
After all, that's what duck-typing is about. There is no official interface declaration, just an implicit protocol. And private methods or members are part of that protocol as well. I don't think so. Duck-typing is about implementing the expected public interface, and has nothing to do with

Re: Calling private base methods

2007-04-15 Thread Isaac Rodriguez
The fact that I had to resort to this trick is a big indication of course that genuinely private members (as opposed to a 'keep off' naming convention) are a bad idea in general. The fact that you had to resort to this trick is a big indication that the library you were using is bad

Are all classes new-style classes in 2.4+?

2006-12-31 Thread Isaac Rodriguez
Hi, This is probably a very basic question, but I've been playing with new style classes, and I cannot see any difference in behavior when a declare a class as: class NewStyleClass(object): or class NewStyleClass: I declare property members in both and it seems to work the exact same way. I

Re: One module per class, bad idea?

2006-12-12 Thread Isaac Rodriguez
Yes, it would be a bad idea. =) Saying it is a bad idea and not explaining why will not help anyone. I would like you to elaborate on why it is a bad idea to have one file per class. Thanks, - Isaac. -- http://mail.python.org/mailman/listinfo/python-list

Re: One module per class, bad idea?

2006-12-12 Thread Isaac Rodriguez
make the import statements look good. You can still make your import statements look good and have one class per file, that's one of the __init__.py wonderful features. Also, C++ support stand alone functions and the rule is to organize classes and their interface (functions that operate

Experiences with Py2Exe

2006-10-11 Thread Isaac Rodriguez
Hi, I am looking for feedback from people that has used or still uses Py2Exe. I love to program in python, and I would like to use it to write support tools for our development team, but I cannot require everyone to install python in their machines, so I was thinking that Py2Exe would help on

Re: Experiences with Py2Exe

2006-10-11 Thread Isaac Rodriguez
I did a project with wxPython and py2exe. Just great :-) I also used Inno Setup (http://www.jrsoftware.org/isinfo.php) to create an installer. You should be able to learn/use both in one day. Do you have a specific reason for using Inno Setup and not a Windows Installer based setup? Will

CAB files manipulation API (again).

2005-06-28 Thread Isaac Rodriguez
to manipulate CAB files? Thanks, -- Isaac Rodriguez SWE Autodesk. There are 10 types of people. Those who undertand binary, and those who don't -- http://mail.python.org/mailman/listinfo/python-list

Python API to manipulate CAB files.

2005-06-22 Thread Isaac Rodriguez
Does anyone know of a Python API to manipulate CAB files? Thanks, -- Isaac Rodriguez SWE Autodesk. There are 10 types of people. Those who undertand binary, and those who don't -- http://mail.python.org/mailman/listinfo/python-list

Documenting Python code.

2005-05-03 Thread Isaac Rodriguez
to document their code. If there is no standard way to do this inside the Python community, does anyone feels there is a need for standarizing it? Thanks, -- Isaac Rodriguez SWE Autodesk. There are 10 types of people. Those who undertand binary, and those who

Coding Standards (and Best Practices)

2005-04-26 Thread Isaac Rodriguez
of guidelines and best practices as our coding standards. Does anyone know where I can get some information about what the community is doing? Are there any well defined guidelines established? Thanks, -- Isaac Rodriguez SWE Autodesk. There are 10 types