Re: How do I edit a PythonWin path to import custom built modules???

2006-12-13 Thread Gabriel Genellina
the Path variable. I have no doubt that you're correct. Just confused as usual. import sys print sys.path and see what's there. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam

Re: Defining classes

2006-12-13 Thread Gabriel Genellina
injal(weeble) Not perfect but manageable I think... -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar -- http://mail.python.org/ma

Re: Password, trust and user notification

2006-12-13 Thread Gabriel Genellina
Preference=50, Mail Exchange=gsmtp163.google.com Preference=50, Mail Exchange=gsmtp183.google.com -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - htt

Re: speed of python vs matlab.

2006-12-13 Thread Gabriel Genellina
or-oriented operations the NumArray package is well suited. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar -- http://mail.python.org/mailman/listinfo/python-list

Re: Password, trust and user notification

2006-12-13 Thread Gabriel Genellina
. The *from* email address is irrelevant and can even be faked. Of course a spam filter could block such mails, but you have to test it. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡g

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-13 Thread Gabriel Genellina
should be "python_script.py" You may want to un-select "Hide extensions for known file types" in Windows Explorer options. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispa

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread Gabriel Genellina
;enter the Python interpreter" that means "execute python from the command line", not PythonWin nor IDLE nor... -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar -- http://mail.python.org/mailman/listinfo/python-list

Re: variables with dynamicly generated names

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 05:50, avlee wrote: Is it possible to use in python variables with dynamicly created names ? How ? Use a dictionary: d = {} d[almost_arbitrary_key] = value -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio

Re: logging

2006-12-14 Thread Gabriel Genellina
): return (record.levelno >= self.levelmin and record.levelno <= self.levelmax) and add an instance of LevelFilter to each handler. (Untested) -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antiv

Re: Working w/ Yield

2006-12-14 Thread Gabriel Genellina
= quotes[num] path = luckyWinner.absolute_url() return path Should work, untested... -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar -- http://mail.python.org/mailman/listinfo/python-list

Re: WHAT is [0] in subprocess.Popen(blah).communicate()[0]

2006-12-14 Thread Gabriel Genellina
At Thursday 14/12/2006 15:30, Neil Cerutti wrote: I like using pattern matching in these simple cases: last_line, _ = subprocess.Popen([r"tail","-n 1", "x.txt"], stdout=subprocess.PIPE).communicate() pattern matching??? --

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread Gabriel Genellina
7;b' referenced before assignment Compare your function with the version shown in the tutorial. Variable 'b' is assigned on the previous line. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, anti

Re: Need Simple Way To Determine If File Is Executable

2006-12-14 Thread Gabriel Genellina
more, or so broad to consider all things that os.startfile can handle without error. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com

Re: Password, trust and user notification

2006-12-14 Thread Gabriel Genellina
ersed: keep a remotely accesable log of events and let the user look at it whenever he wants. - Variant: an RSS feed - Telegram - Smoke or dum signals -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivi

Re: I'm looking for a pythonic red-black tree...

2006-12-14 Thread Gabriel Genellina
s you to do... There are several implementations, try google... -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar -- http://mail

Re: merits of Lisp vs Python

2006-12-14 Thread Gabriel Genellina
fundamental unit and even NO fundamental units. There is a nice book about this subject by L. A. Sena: Units of physical quantities and their dimensions (or similar, I don't have it at hand to check the title). -- Gabriel Genellina Softla

Re: Is it good to create a thread in a non gui thread?

2006-12-14 Thread Gabriel Genellina
u can have a non gui application -an HTTP server by example- using many threads with no problems. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! -

Re: Is it good to create a thread in a non gui thread?

2006-12-14 Thread Gabriel Genellina
At Friday 15/12/2006 02:15, Lialie - KingMax wrote: Please keep your posting on the list. Gabriel Genellina wrote: > At Thursday 14/12/2006 23:55, Lialie - KingMax wrote: > >> I create a thread in a non gui thread, and it does well. But it seems >> strange. Somebody told me

Re: How do I edit a PythonWin path to import custom built modules???

2006-12-15 Thread Gabriel Genellina
write, in ATS.py: from LevelRegulation import whatever from CurveDetection.MyModuleName import MyClass etc. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta

Re: Conditional iteration

2006-12-15 Thread Gabriel Genellina
, 4])) Be aware that map, filter, and reduce may be dropped in Python 3000. http://www.artima.com/weblogs/viewpost.jsp?thread=98196 (and I won't miss them if gone) -- Gabriel Genellina Sof

Re: Roundtrip SQL data especially datetime

2006-12-15 Thread Gabriel Genellina
slates into a string like '2005-08-03 07:32:48'. No problem > with that -- all works quite nicely, until you try to put data back the > other way. Dont convert to string and keep the datetime object. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: AI library

2006-12-15 Thread Gabriel Genellina
a singleton, compare using "x is None" or "x is not None", dont use == This is more stylish, but I prefer to use isxxx() or hasxxx() for functions that return booleans. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Restrictive APIs for Python

2006-12-15 Thread Gabriel Genellina
rectly accessing the private internals of a class. In Python, the usual way of saying "don't play with me" is prepending an underscore: _private BTW, have you *ever* tested your code? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Restrictive APIs for Python

2006-12-15 Thread Gabriel Genellina
On 15 dic, 13:46, "Will Ware" <[EMAIL PROTECTED]> wrote: > Gabriel Genellina wrote: > > In Python, the usual way of saying "don't play with me" is prepending > > an underscore: _private > Thanks, I am familiar with that. So enforce it instead of g

Re: Designing a cancellable function

2006-12-15 Thread Gabriel Genellina
't provide a callback at all, or it's an empty one, or it contains just a print ".", statement, all of these returning False; so, to actually abort the process it must have an explicit "return True" statement). -- Gabriel Genellina Softlab SRL ___

Re: Need Simple Way To Determine If File Is Executable

2006-12-16 Thread Gabriel Genellina
, portable or not? Unless the OS actually tries to load and examine the file contents, which the OS's I'm aware of, don't do. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Package vs. module

2006-12-16 Thread Gabriel Genellina
rom the library would be a good thing. So, keep your library inside a package, and provide some external scripts as example, demo, whatever. You can instruct distutils to install each thing in the right place. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: catching exceptions

2006-12-16 Thread Gabriel Genellina
o > do more than just storing the value. You've provided the answer: properties are OK if you need to do "more" that just store the value. Else, they're a waste of programmer and processor time. That was not clear on your original post. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to push data into Microsoft Oulook from Python ?

2006-12-16 Thread Gabriel Genellina
t.com Googling with "outlook application python" will give you more help. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: module wide metaclass for new style classes

2006-12-16 Thread Gabriel Genellina
asses: from inspect import isclass for obj in globals().values(): if isclass(obj): # may be stricter too, like issubclass(obj, Base) reg.append(obj) -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Core dump revisited

2006-12-18 Thread Gabriel Genellina
bably the error is inside the C extension, not in Python code. Contact the author. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Gabriel Genellina
ctually > a binary executable. A similar function exists on Linux too. But even if a file has the right file format, if it does not have the execute bit set, won't run. And you could set that bit on a JPG image too - and nothing good would happen, I presume. So one must determine first what means "the file is executable". -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Need Simple Way To Determine If File Is Executable

2006-12-18 Thread Gabriel Genellina
ociation defined and run that program if there is. b) If the file *is* "executable", run it. This is what os.startfile does. The underlying Win32 functions would be ShellExecute, FindExecutable & their variants. Will you maintain your own registr

Re: connecting webservers through HTTP port using python

2006-12-18 Thread Gabriel Genellina
che server by python code. give suggestions.. See the httplib module -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.com.a

Re: Script to upload Files via http/cgi

2006-12-18 Thread Gabriel Genellina
At Monday 18/12/2006 12:30, Richard Konrad wrote: Does anyone know about a python-script to upload Files via http/cgi? See the urllib2 module. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y

Re: Strange error with getattr() function

2006-12-18 Thread Gabriel Genellina
ght be retrieving another thing... The *strange* is that I get the same error even if I pass the attribute name to the getattr() function as pure string: getattr(container,"WorkFlowTest") (sic!) If you're really sure of this, I think the error may occur inside another funct

Re: Strange error with getattr() function

2006-12-18 Thread Gabriel Genellina
ion?) If you don't catch the exception, an error page will be displayed, pointing to the error_log object. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber

Re: Windows Authetication vs seperate process

2006-12-18 Thread Gabriel Genellina
ocus on the the tasks within our application the user is authorized to perform" Search for SSPI. But it may be a bit tricky to get running. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispa

Re:

2006-12-18 Thread Gabriel Genellina
ry javadoc (the java package), it is easier to use than a pure reflection approach. -- Gabriel Genellina Softlab SRL __ Correo Yahoo! Espacio para todos tus mensajes, antivirus y antispam ¡gratis! ¡Abrí tu cuenta ya! - http://correo.yahoo.

Re: Is htmlGen still alive?

2006-12-19 Thread Gabriel Genellina
x27;t change all days, and being a python only library, the only changes would be due to compatibility issues or adopting new language features of new python versions. BTW, I like HyperText more than htmlgen. -- Gabriel Genellina Softla

Re: update attribute - (newbie)

2006-12-20 Thread Gabriel Genellina
ut will raise KeyError instead) A property is more convenient in this case. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Y

Re: what is wrong with my code?

2006-12-20 Thread Gabriel Genellina
exception, full traceback as printed by the interpreter? - Python version in use? -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo

Re: calling a class instance of function

2006-12-20 Thread Gabriel Genellina
arameter (usually called "self") that refers to the instance on which you call the method (like "this" on other languages, but you have to be explicit in Python). Read the Python tutorial: http://docs.python.org/tut/ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: Using difflib to compare text ignoring whitespace differences

2006-12-20 Thread Gabriel Genellina
a in d.compare([' a larger line'],['a longer line']): print delta -a larger line ? --- ^^ + a longer line ?^^ -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: list1.append(list2) returns None

2006-12-20 Thread Gabriel Genellina
> > def enlargetable(table,col): > > return table.append(col) Google for "python pitfalls" -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: list1.append(list2) returns None

2006-12-21 Thread Gabriel Genellina
At Thursday 21/12/2006 14:50, Matimus wrote: The following will do exactly the same thing as the above: [code] def enlargetable(table,col): table.append(col) return table [/code] Which, by the way, was one of the first answers he got, by Edward Kozlowski. -- Gabriel Genellina

Re: Displaying contents of a file using PyWin

2006-12-21 Thread Gabriel Genellina
ses a different exception now. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.yaho

Re: removing the header from a gzip'd string

2006-12-21 Thread Gabriel Genellina
part of the clear message is a security hole. Using an structured container (like a zip/rar/... file) gets worse because the fixed (or "guessable") part is longer, but anyway, 2 bytes may be bad enough. See RFC1950 <ftp://ftp.isi.ed

Re: removing the header from a gzip'd string

2006-12-22 Thread Gabriel Genellina
Fredrik Lundh ha escrito: > Gabriel Genellina wrote: > > > If you want to encrypt a compressed text, you must remove redundant > > information first. > > encryption? didn't the OP say that he *didn't* plan to decompress the > resulting data stream? I was

Re: How to distribute an additional DLL to site-packages?

2006-12-22 Thread Gabriel Genellina
entation may be arcane sometimes, but this is easily found at http://docs.python.org/dist/node12.html) Absolute dirs are almost never necesary, usually all distutils commands operate on relative paths (relative to location of setup.py for source files, relative to some meaningful directory for targets). -- Gab

Re: stoppable child thread

2006-12-22 Thread Gabriel Genellina
child threads, then do something, then > when got ^C keyboard exception, stop the child thread. You've created the threads, you've handled ^C, what's missing...? -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
__init__.py) so from "outside", people can say: from foo.bar import MyClass if you consider MyClass being in its own module an implementation detail that should be hidden. Module layout is an important design concept -- Gabriel Genellina S

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
the same. That's all - most of the time. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Proba

Re: scopes of local and global variable

2006-12-22 Thread Gabriel Genellina
At Friday 22/12/2006 20:45, Pyenos wrote: # Error message says: # # UnboundLocalError: local variable 't_len' referenced before assignment# See item 6 in "10 Python pitfalls": <http://zephyrfalcon.org/labs/python_pitf

Re: let me simplify my question on scope of vars

2006-12-22 Thread Gabriel Genellina
e not declared it as global inside def METHOD2. so var within def METHOD2 is a different variable to the global variable var. Read the Python Pitfalls I've send some minutes ago, and the tutorial (specially http://docs.python.org/tut/node11.html#scopes) and then re-answer your own quest

Re: One module per class, bad idea?

2006-12-22 Thread Gabriel Genellina
t an implementation detail, and not part of the package public interfase. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respu

Re: httplib and socket.getaddrinfo

2006-12-23 Thread Gabriel Genellina
46.198.60', 21)) (2, 1, 0, '', ('207.46.199.30', 21)) (2, 1, 0, '', ('207.46.225.60', 21)) (2, 1, 0, '', ('207.46.19.30', 21)) (2, 1, 0, '', ('207.46.19.60', 21)) (2, 1, 0, '', ('207.46.20.30'

Re: some OT: how to solve this kind of problem in our program?

2006-12-26 Thread Gabriel Genellina
no dupes on the first column) but anyway its a large number... (Or I'm wrong computing the possibilities...) -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías sab

Re: keypressed() function

2006-12-26 Thread Gabriel Genellina
WM_KEYDOWN/WM_KEYUP. Or, for a specific key, you can use GetKeyState/GetAsyncKeyState. For the whole keyboard use GetKeyboardState. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que

Re: Type text global

2006-12-26 Thread Gabriel Genellina
ook.exe". I'm using windows xp. There is a module named SendKeys which may be useful, try to find it. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y

Re: Fuzzy string comparison

2006-12-26 Thread Gabriel Genellina
files, and is relatively slow. Google "python levenshtein". You'll probably find this a better fit for typoed keys in a database. Other alternatives: trigram, n-gram, Jaro's distance. There are some Python implem. a

Re: Splitting lines from a database query

2006-12-26 Thread Gabriel Genellina
ite the text "None" whenever the field is empty, so you will never get , instead: None. If you want to get the former, use: if fname is None: fname = "" -- Gabriel Genellina Softlab SRL __ Pregunt

Re: Persistent variables in python

2006-12-26 Thread Gabriel Genellina
xcept AttributeError: doStuff.timesUsed = 1 # ... special case for first call ... # ...common code... If you need to code something special for the 2nd and following calls, add an else: clause -- Gabriel G

Re: module with a threading-like api that uses processes?

2006-12-26 Thread Gabriel Genellina
ver'", and uses stdin and stdout of that process as a communication channel.) There is no need for interface definitions, no need to open communication ports, no need to copy remotely run function code to remote hosts. http://www.cs.tut.fi/~ask/rthread/index.html -- Gabr

Re: how can I modify an imported variable ?

2006-12-27 Thread Gabriel Genellina
y the other thread. is this possible ? Put some print statements and see what happens. I'm sure things are a lot simpler than you think. You said a module, but now you use MyPackage - how do you assign to MyPackage.aVariable? inside its __init__.py? -- Gabriel Genellina S

Re: getting a process's PID

2006-12-27 Thread Gabriel Genellina
libraries -like PIL- require at least 1.5 -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya

Re: Persistent variables in python

2006-12-27 Thread Gabriel Genellina
getattr to see if it raises an exception (this is documented behavior, not a hidden implementation detail). In Python it's far more common EAFP ('easier to ask for forgiveness than permission') than LBYL ('look bef

Re: Fuzzy string comparison

2006-12-27 Thread Gabriel Genellina
lbox, and A Digital Government Web Service (2003) Mohamed G. Elfeky, Vassilios S. Verykios, Ahmed K. Elmagarmid, Thanaa M. Ghanem, Ahmed R. Huwait. http://citeseer.ist.psu.edu/elfeky03record.html -- Gabriel Genellina

Re: Superclass for Errors?

2006-12-27 Thread Gabriel Genellina
- other classes not derived from Exception: still legal, probablly not on future Python versions. If you really have to catch any kind of exception, use a bare except clause; you always can retrieve the exception details using sys.exc_info() -- Gabriel G

Re: failing to instantiate an inner class because of its order

2006-12-27 Thread Gabriel Genellina
del exists by itself even before you need the view, so usually the view constructor gets the model as an argument. I prefer to use lowercase attribute names: self.model = Model(), this way there is no confusion between model (an instance) and Model (a class). -- Gabriel Genellina S

Re: DOS, UNIX and tabs

2006-12-27 Thread Gabriel Genellina
d over tabs. Of course you can do it anyway you like, but you should have a *strong* reason for not following a *strong* recommendation. (Just a note, you can use untabify.py (inside the Tools dir) to convert tabs to spaces, instead of unexpand) -- Gabriel Gene

Re: Hooking any/all 'calls'

2006-12-27 Thread Gabriel Genellina
class who's "__call__" method can be wrapped to do this? See Stain Soiland's site http://soiland.no/software/decorator for his logging decorator and logging metaclass. -- Gabriel Genellina Softlab SRL ___

Re: can't instantiate following inner class

2006-12-27 Thread Gabriel Genellina
u make Python silently ignore the arguments? -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! ht

Re: socket.gaierror: (-2, 'Name or service not known')

2006-12-27 Thread Gabriel Genellina
entation, or somewhere. Anyway, choose_boundary() should be robust enough to catch the possible exception and act accordingly, I think. In the meantime, you may put this near the top of your script: mimetools._prefix = &quo

Re: socket.gaierror: (-2, 'Name or service not known')

2006-12-27 Thread Gabriel Genellina
&aid=1250170&group_id=5470&atid=105470 Should work on Python 2.4.4 and later. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginab

Re: I'm having trouble understanding scope of a variable in a subclass

2006-12-28 Thread Gabriel Genellina
7;t need a nested class at all. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http://www.ya

Re: I'm having trouble understanding scope of a variable in a subclass

2006-12-28 Thread Gabriel Genellina
but certainly is *not* a recommended newbie practice. It's like using the accelerator and brake at the same time when driving - an experienced driver *might* do that in certain circunstances, but if you are learning to drive, you either accelerate or either use the brake but NOT both. --

Re: I'm having trouble understanding scope of a variable in a subclass

2006-12-28 Thread Gabriel Genellina
ibute of Class1. Putting all this together, you can refer to such "var" as Class1.Class2.Class3().var -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías

Re: Generating text files (newbie)

2006-12-28 Thread Gabriel Genellina
ot;foo.txt", "r"), delimiter='\t') output = open("bar.txt","wt") for row in params: output.write("%s IRM=3PL IPB=%s\n" % (row[0], row[1])) output.close() params.close() -- Gabriel Genellina Softlab SRL __

Re: __getattr__ possible loop

2006-12-28 Thread Gabriel Genellina
clear: import sys class Foo: def __getattr__(self, attr): print "About to exit program" sys.exit(1) f = Foo() dir(f) print "You should not see this line" -- Gabriel Genellina Softlab SRL __

Re: Slowdown in Jython

2006-12-28 Thread Gabriel Genellina
like it's running out of memory and is being forced to use extended memory, but I do not know enough about the Only a standard advise: try not to load all the records together, instead, if possible, process them one record at a time. This way you're not bound by available memory.

Re: xml bug?

2006-12-28 Thread Gabriel Genellina
def _parse_ns_name(...): ...doing the right thing... from xml.dom import modulename modulename._parse_ns_name = _parse_ns_name (maybe checking version numbers too) -- Gabriel Genellina Softlab SRL __

Re: Reverse of SendKeys??

2006-12-28 Thread Gabriel Genellina
At Thursday 28/12/2006 15:39, Scripter47 wrote: A module that gets _anything_ what the keyboard writes. You want a "keylogger" -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí

Re: A stupid question

2006-12-28 Thread Gabriel Genellina
plications depending on it, like the bittorrent client. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta).

Re: A stupid question

2006-12-28 Thread Gabriel Genellina
At Friday 29/12/2006 01:05, [EMAIL PROTECTED] wrote: The specified module could not be found. LoadLibrary(pythondll) failed For the bittorrent client, reinstalling it should be enough. For other issues on your system, best to contact your vendor. -- Gabriel Genellina Softlab SRL

Re: I want to see all the variables

2006-12-29 Thread Gabriel Genellina
e in the class __dict__, where do they live? What other methods and attributes are invisibly in X? They live in the C structure implementing the type; members tp_bases and tp_name respectively. Most predefined type/class attributes have an slot for storing i

Re: Starting a child process and getting its stdout?

2006-12-29 Thread Gabriel Genellina
icate(), etc and it is always the same. Did you *actually* tried what Tom Plunket posted? Two tiny chars make a difference. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que qu

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Gabriel Genellina
path- create a new key below App Paths, named "python.exe", and set its default value to the full path of the installed python executable. See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/fileassociations/fa_perce

Re: Python embedded interpreter: how to initialize the interpreter ?

2007-01-02 Thread Gabriel Genellina
ule not defined Does it work if you try it from the interpreter? -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! R

Re: trees, iterations and adding leaves

2007-01-02 Thread Gabriel Genellina
while ids: key = ids.pop(0) tree = tree[key] return tree and say: traverse_tree(tree6, 0, 1, 0, 1, 1, 1, 0) or traverse_tree(tree6, *[0,1,0,1,1,1,0]) or traverse_tree(tree6, *[0,1,0,1,1])[0] = another_object -- Gabriel Genellina Softlab SRL

Re: Why does Python never add itself to the Windows path?

2007-01-02 Thread Gabriel Genellina
t the command line, it fails. Typing "start firefox" at the command line should work. It appears that cmd.exe does *not* use ShellExecute to find the executable, so this approach doesn't work as expected :( -- Gabriel Genellina Softlab SRL

Re: Iterate through list two items at a time

2007-01-02 Thread Gabriel Genellina
in b): print x,y Create this list: [(1,2), (3,4), (5,6)] b=iter(a) [(item, b.next()) for item in b] Note that they don't behave the same at the corner cases (empty list, single item, odd length...) -- Gabriel Genellina S

Re: pythoncom module

2007-01-03 Thread Gabriel Genellina
At Friday 29/12/2006 05:55, Scripter47 wrote: I need a module called "pythoncom" anyone that knows where a can find that module??? It's part of the pywin32 package https://sourceforge.net/project/showfiles.php?group_id=78018 -- Gabriel Genell

Re: import order or cross import

2007-01-03 Thread Gabriel Genellina
not be used (imported) by anyone. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! Respuestas (Beta). ¡Probalo ya! http

Re: Unsubscribing from the list

2007-01-03 Thread Gabriel Genellina
default MailMan administrative interfase. Send a RFE to the MailMan developers. -- Gabriel Genellina Softlab SRL __ Preguntá. Respondé. Descubrí. Todo lo que querías saber, y lo que ni imaginabas, está en Yahoo! R

Re: type classobj not defined?

2007-01-03 Thread Gabriel Genellina
e isinstance or issubclass instead, they check for derived classes too. A derived class can (or could) always be used wherever a base class is suitable. -- Gabriel Genellina Softlab SRL __ Preguntá. Respo

Re: static object

2007-01-03 Thread Gabriel Genellina
e properties, descriptors, and such, look for the Singleton (or Borg) pattern in the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/ -- Gabriel Genellina Softlab SRL __ Preguntá. Re

Re: code optimization (calc PI)

2007-01-03 Thread Gabriel Genellina
as above pi = pi + str("%04d" % int(e + d/a)) ## this should be fast?! I dont Someone else already pointed out how to improve this. You don't show the rest of the code... -- Gabriel Genellina Softlab SRL _

Re: code optimization (calc PI) / Full Code of PI calc in Python and C.

2007-01-03 Thread Gabriel Genellina
sys.stdout.writelines(pi()) (The converted C code does a lot of nonsense in Python terms - maybe you should try to interpret *what* it does and then reimplement that using Python) -- Gabriel Genellina Softlab SRL

Re: pow() works but sqrt() not!?

2007-01-04 Thread Gabriel Genellina
At Thursday 4/1/2007 10:12, siggi wrote: Thanks for the explanation. I am astonished what an interpreted language is able to do! Python is as interpreted as Java. Its numerical capabilities are more or less independent of this fact, I'd say. -- Gabriel Genellina Softla

<    2   3   4   5   6   7   8   9   10   11   >