Create multiple variables (with a loop?)

Gökhan SEVER gokhansever at gmail.com
Sat Jun 6 03:44:29 CEST 2009


You could use locals() for dynamic variable names creation.

Additionally, you can give to Mayavi a try for visualization of your data:

http://code.enthought.com/projects/mayavi/

Gökhan


On Fri, Jun 5, 2009 at 2:35 PM, Philip Gröger <philip.groeger at googlemail.com
> wrote:

> Hi,
> I need to create multiple variables (lets say 10x10x10 positions of atoms).
> Is it possible to create them through a loop with some kind of indexing like
> atom000, atom001, etc?
> Or is this a very bad idea?
>
> Thing is ... i want to create a grid of atoms in vpython and then calculate
> the forces for each of them (to their neighbours). Don't know how else I
> could do that. Maybe a huuuge matrix?
>
> Thx for your help!
> - Philip
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090605/5af6e1be/attachment.html>


More information about the Python-list mailing list