Re: How to clear all content in a Tk()

2014-03-25 Thread Marcel Rodrigues
What about this: Put a Frame() inside the root: `frame = Frame(root)`. This frame will be the only immediate child of root. Everything else will be put inside the frame. When you need to clear the root, call `frame.destroy()`. This will destroy `frame` and all its children. You will need to recrea

Re: What is the recommended python module for SQL database access?

2014-02-09 Thread Marcel Rodrigues
at 9:20 PM, Marcel Rodrigues > wrote: > > As Chris said, if your needs are simple, use SQLite back-end. It's > probably > > already installed on your computer and Python has a nice interface to it > in > > its standard library. > > Already installed? I th

Re: Why use _mysql module and not use MySQLdb directly?

2014-02-09 Thread Marcel Rodrigues
Another option is PyMySQL [1]. It's developed in the open at GitHub [2]. It's pure Python, compatible with both Python 2 and Python 3. It's DB-API 2 compliant. It also implements some non-standard bits that are present in MySQLdb, in order to be compatible with legacy code, notably Django (personal

Re: What is the recommended python module for SQL database access?

2014-02-09 Thread Marcel Rodrigues
As Chris said, if your needs are simple, use SQLite back-end. It's probably already installed on your computer and Python has a nice interface to it in its standard library. [1] If you decide to use MySQL back-end instead, consider using PyMySQL [2]. It's compatible with both Python 2 and Python 3

Re: "Nested" virtual environments

2013-08-15 Thread Marcel Rodrigues
I don't know how to completely solve this problem, but here is something that can alleviate it considerably. If you have a recent version of pip, you can use wheels [1] to save built packages locally. First create a new virtualenv and install the common packages. Then put these packages in a wheel

Re: weird behavior. bug perhaps?

2013-06-18 Thread Marcel Rodrigues
Note that print [shape(m)[1],1] just prints a list with two elements where the first element is shape(m)[1] and the second is the number 1 (regardless of the value of m). I'm pretty sure that's not what you want. 2013/6/18 zoom > Hi, I have a strange problem here. Perhaps someone would care t

Re: Fatal Python error

2013-05-29 Thread Marcel Rodrigues
er the Py3 behavior here a bug, that code is unreliable by design. It's an infinite loop at the best. 2013/5/29 Joshua Landau > On 29 May 2013 13:30, Marcel Rodrigues wrote: > > > > I just tried your code with similar results: it does nothing on PyPy > 2.0.0-beta2 and Pyt

Re: Fatal Python error

2013-05-29 Thread Marcel Rodrigues
I just tried your code with similar results: it does nothing on PyPy 2.0.0-beta2 and Python 2.7.4. But on Python 3.3.1 it caused core dump. It's a little weird but so is the code. You have defined a function that calls itself unconditionally. This will cause a stack overflow, which is a RuntimeErro

Re: Python 3.3, gettext and Unicode problems

2012-12-30 Thread Marcel Rodrigues
Thank you Terry! I was trying to follow the documentation but somehow didn't payed attention to the lgettext/gettext distinction until I read your first response. Changing lgettext to gettext solved the problem. It prints correctly to my console because I have to environmental variable PYTHONIOEN

Python 3.3, gettext and Unicode problems

2012-12-30 Thread Marcel Rodrigues
I'm using Python 3.3 (CPython) and am having trouble getting the standard gettext module to handle Unicode messages. My problem can be isolated as follows: I have 3 files in a folder: greeting.py, greeting.po and msgfmt.py. -- greeting.py -- import gettext t = gettext.translation("greeting", "lo