Aviate, the Web Deployer

2008-12-01 Thread Amr
Announcing the first public release of Aviate, a cross-platform web
deployment tool written in Python.

Aviate is designed to make deploying your web applications very easy,
while providing you with a rich feature set to make repeated task
performed in a snap, and being extensible so you can extend its
features with your own Python code.

Among its feature is being based on XML, an intuitive GUI to create
deployment files, a large number of built-in commands, multiple
protocol support, extensibility, language constructs, and more.

More details on Aviate:
http://www.vimov.com/aviate/

Download:
http://www.vimov.com/aviate/download/

Front-end:
http://blog.vimov.com/2008/11/aviate-front/
--
http://mail.python.org/mailman/listinfo/python-list


Default padding for Tkinter grid

2009-05-04 Thread Amr
Hello all,

I've been spending the last few days experimenting with Tkinter. The
grid manager is nice and easy to use, but I have found that I am often
having to specify padx and pady options to every widget I add to my
grid. The way I am doing it is to create a dictionary:

paddding = {'padx': '1m', 'pady': '1m'}

and then apply it to the grid method using **padding.

However, I was wondering if there was a way of setting default padx
and pady controls for the grid, so that I can just call grid without
having to specify any extra parameters.

Thanks,

--Amr
--
http://mail.python.org/mailman/listinfo/python-list


Re: Default padding for Tkinter grid

2009-05-04 Thread Amr
On May 4, 3:57 pm, "Gabriel Genellina"  wrote:
> En Mon, 04 May 2009 10:27:49 -0300, Amr  escribió:
>
> > I've been spending the last few days experimenting with Tkinter. The
> > grid manager is nice and easy to use, but I have found that I am often
> > having to specify padx and pady options to every widget I add to my
> > grid. The way I am doing it is to create a dictionary:
>
> > paddding = {'padx': '1m', 'pady': '1m'}
>
> > and then apply it to the grid method using **padding.
>
> > However, I was wondering if there was a way of setting default padx
> > and pady controls for the grid, so that I can just call grid without
> > having to specify any extra parameters.
>
> You have to call grid() once on every widget, so adding **padding at the  
> end doesn't appear too bad to me:
>
>    label = Label(master, text="Hello world!")
>    widget.grid(row=3, col=1, **padding)
>
> What about a function:
>
> def grid_with_padding(widget, padx='1m', pady='1m', **kw):
>    widget.grid(padx=padx, pady=pady, **kw)
>
> If you want an uniform padding:
>
> def add_padding(container, padx='1m', pady='1m'):
>    nc, nr = container.grid_size()
>    for i in range(nc):
>      container.grid_columnconfigure(i, pad=padx)
>    for i in range(nr):
>      container.grid_rowconfigure(i, pad=pady)
>
> --
> Gabriel Genellina

Hi Gabriel,

Thanks for your reply - I like the method you mention at the end,
using grid_columnconfigure and grid_rowconfigure as I can use that to
apply setting to the whole grid at the end. I'll have a mess around
with it.

--Amr
--
http://mail.python.org/mailman/listinfo/python-list


Could this expression parser be more 'Pythonic'?

2009-05-06 Thread Amr
Hello all,

I've been spending the last few weeks learning Python, and I've just
started to use it to write a simple BASIC compiler. I'm writing a
mathematical expression parser and wrote a function that would take a
string and split it into high level tokens.

The code can be found at http://pastebin.com/f757252ec (have a look at
the function tokenize).

I was interested to see if the tokenize function could be written in a
better way, so as to make better use of the Python language and
libraries. One thing that sprung to mind was whether it would be a
good idea to perhaps take advantage of regular expressions. I had a
look at a few compiler sites and regexps seem to come into that role
quite a bit. I've only done a little work on regexps and they seem
very powerful, but can easily get out of control!

So, any suggestions as to how to make better use of the language
writing something like this?

Thanks,

--Amr
--
http://mail.python.org/mailman/listinfo/python-list


Re: Could this expression parser be more 'Pythonic'?

2009-05-07 Thread Amr
Hi John,

Thanks for the tips, I will check them out.

--Amr
--
http://mail.python.org/mailman/listinfo/python-list