Checking if a variable is a dictionary

2008-03-06 Thread Guillermo
Hello, This is my first post here. I'm getting my feet wet with Python and I need to know how can I check whether a variable is of type dictionary. Something like this: if isdict(a) then print "a is a dictionary" Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking if a variable is a dictionary

2008-03-06 Thread Guillermo
a", 'b':(1,2,3),'c':{'a':"i'm a",'x':"something",'y': ('a','b','c')}} I'm just designing the algorithm, but I think Python dictionaries can hold any kind of sequence? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking if a variable is a dictionary

2008-03-06 Thread Guillermo
than Python. I've read a bit about Python protocols, but where could I get some more info on implementation details? Sounds very interesting. Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking if a variable is a dictionary

2008-03-09 Thread Guillermo
Is it just a matter of extending the different object classes (dict, list, tuple...)? Where do you put the interface/protocol code? :-? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Checking if a variable is a dictionary

2008-03-09 Thread Guillermo
here's the catch now -- you must rely on the fact that the protocol is implemented, there's no way to enforce it if you're expecting a parrot-like object. You'd try to call the speak() method and deal with the error if there's no such method? Thanks a lot! Guillermo -- http

Python 2.5 + sqlite full text search possible?

2008-10-28 Thread Guillermo
Hi! Is it possible to load the full-text search module for the SQLite version bundled with Python 2.5? I've tested it and the stand-alone SQLite distribution doesn't seem to include it (sqlite> .load fts2), nor does Python. I'm on Windows XP. Regards, Guillermo -- http

Python 2.5 + sqlite full text search possible?

2008-10-28 Thread Guillermo
Hi! Is it possible to use the full-text module of SQLite with the sqlite3 module? I've done a bit of investigation and it seems the stand-alone distribution of SQLite is compiled without it, and so does the version bundled with Python. Regards, Guillermo -- http://mail.python.org/ma

passing *args "recursively"

2008-05-12 Thread Guillermo
(args) func1(1,2,3) Thanks! Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Keep a script running in the background

2008-06-03 Thread Guillermo
king with an UI, hope that can be made easily in Python somehow. Cheers, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Keep a script running in the background

2008-06-03 Thread Guillermo
These are the basic requirements: Script A must keep a dictionary in memory constantly and script B must be able to access and update this dictionary at any time. Script B will start and end several times, but script A would ideally keep running until it's explicitly shut down. I have the feelin

Getting python 2.4 dll

2008-07-28 Thread Guillermo
Hi there, Is it possible to get a 2.4 dll of python for Windows easily? I need it to use python as scripting language for Vim. Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Opposite of repr() (kind of)

2008-04-21 Thread Guillermo
Hi there, How can I turn a string into a callable object/function? I have a = 'len', and I want to do: if callable(eval(a)): print "callable", but that doesn't quite work the way I want. :) Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Opposite of repr() (kind of)

2008-04-21 Thread Guillermo
This must be the dumbest question ever... Solved. On Apr 21, 1:05 pm, Guillermo <[EMAIL PROTECTED]> wrote: > Hi there, > > How can I turn a string into a callable object/function? > > I have a = 'len', and I want to do: if callable(eval(a)): print > "cal

Uses of docutils

2008-08-31 Thread Guillermo
r for reference? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Algorithm used by difflib.get_close_match

2008-09-02 Thread Guillermo
Hi all, Does anyone know whether this function uses edit distance? If not, which algorithm is it using? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

virtualenv under Win7: easy_install fails in virtual environments

2009-10-25 Thread Guillermo
o my normal, non- admin account. It also fails if I'm running as an administrator and perform the same steps. I've tried runas to no avail too. Is this a known issue? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Python unicode and Windows cmd.exe

2010-03-14 Thread Guillermo
file, I don't know what happens when I save the unmodified file. Also, I would think that the python script should save a valid utf-8 file in the first place... What's going on here? Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Guillermo
ugh the dos console... Cheers, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Guillermo
>    The console is commonly using Code Page 437 which is most compatible > with old DOS programs since it can display line drawing characters. You > can change the code page to UTF-8 with > chcp 65001 That's another issue in my actual script. A twofold problem, actually: 1) For me chcp gives 850

Re: Python unicode and Windows cmd.exe

2010-03-14 Thread Guillermo
e Windows' codepage to 65001 from within the Powershell script and I get back a string encoded in UTF-8 with BOM, so problem solved! Thanks for the help, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

virtualenvwrapper for Windows (Powershell)

2010-05-09 Thread Guillermo
ershell v2. Regards, Guillermo -- http://mail.python.org/mailman/listinfo/python-list

Re: virtualenvwrapper for Windows (Powershell)

2010-05-11 Thread Guillermo
On May 11, 7:43 am, Lawrence D'Oliveiro wrote: > In message > <22cf35af-44d1-43fe-8b90-07f2c6545...@i10g2000yqh.googlegroups.com>, > > Guillermo wrote: > > If you've ever missed it on Windows and you can use Powershell ... > > I thought the whole point of W

Re: virtualenvwrapper for Windows (Powershell)

2010-05-12 Thread Guillermo
On May 12, 4:31 am, Lawrence D'Oliveiro wrote: > In message > <973ca0fa-4a2f-4e3b-91b9-e38917885...@d27g2000yqc.googlegroups.com>, > > Guillermo wrote: > > On May 11, 7:43 am, Lawrence D'Oliveiro > > wrote: > > >> In message > >> <2

Hello World!

2007-05-21 Thread Heizenreder Guillermo
Hello World! I am new in the list -- Heizenreder Guillermo -- -- http://mail.python.org/mailman/listinfo/python-list

getLabel() CD-ROM

2007-08-27 Thread Guillermo Heizenreder
on't wont to my application by dependent on the above class mentioned. Thanks and kind regards from Argentina. P/D: my English it to bad, I'm a novice. [1]http://www.riverbankcomputing.com/Docs/PyKDE3/classref/allclasses.html [2]http://pypi.python.org/pypi/pycdio/0.12 -- H

problem with SQLObject + mysql

2007-08-30 Thread Guillermo Heizenreder
sec) So... how i do to connect?. how create de password correctly? Thanks and kind regards from Argentina. P/D: my English it to bad, I'm a novice, :P. [1]http://www-128.ibm.com/developerworks/library/os-pythonsqlo/index.html?ca=drs#resources -- Heizenreder Guillermo http://code.google.com/u/gheize/ -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with SQLObject + mysql

2007-08-30 Thread Guillermo Heizenreder
El jue, 30-08-2007 a las 07:33 -0300, Guillermo Heizenreder escribió: > Hi list I'm new whit SQLObjet. > I'm study the tutorial:Connecting databases to Python with SQLObjet[1] > > My problem is: > >>>from sqlobject.mysql import builder > >>>con=bu

[pygtk] problem with TreeView + ListStore

2007-09-04 Thread Guillermo Heizenreder
gtk2tutorial/sec-TreeViewSignals.html P/D: my English it to bad, I'm a novice. -- Heizenreder Guillermo http://code.google.com/u/gheize/ -- http://mail.python.org/mailman/listinfo/python-list

[python-list] Problem with SQLObject

2007-10-25 Thread Guillermo Heizenreder
python2.4/site-packages/MySQLdb/connections.py", line 164, in __init__ super(Connection, self).__init__(*args, **kwargs2) TypeError: an integer is required >>> I can't find the mistake. First I thought that not create correctly the conection to mysql, but testening s

Re: [Python-es] Uso de variable Global

2010-12-03 Thread Guillermo Candia Huerta
El 02/12/10 19:04, Pau Cervera escribió: > Ni idea de Tkinter, pero ¿no puedes almacenar *valor* en una variable de > instancia de App y convertir la función *muestra* en un método de la classe > App que teng aceso a las variables de instancia de App? > > - > Pau > > Python..., what else? >