Running external module and accessing the created objects

Kene Meniru Kene.Meniru at
Sat Mar 9 12:05:52 CET 2013

Steven D'Aprano wrote:

> What do you mean, "objects are saved in another object"?
> has a dictionary. When the user describes a wall, it is passed 
to the doc object to be saved in the dictionary. 
> What happens if the user launches appwin with a different argument?
> If appwin can only take one, compulsory, argument, then it's silly 
> require it as an argument. Just have appwin automatically import,
> and do whatever it needs.

I guess my description does not come across well.

I thought sounded like it is, a user created file. It will be 
named differently for each user to created different types of 3D 
objects. It does not make sense to expect every user to name their 
design file the same. So there will have to be a differently named 
single argument for buildeswin.

> This makes no sense to me. Are you saying that appwin opens a text 
> that allows the user to edit the source code?

No. appwin opens an opengl (pyglet.window.Window()) graphics window as 
I mentioned.

> I don't know. How does create the objects? Suppose it users 
> function called "create". Then you would do this in appwin:
> import user
> user.create()

I have tried importing "" and/or "". However there is no 
single command to call.

My program is designed to assist in the building design process. It is 
a big program and the creation of building components takes quite a 
few steps. I do not want to support these steps in a graphics window 
which is why the user uses any text editor they prefer to create 
"". I want "" (which has a graphics window) to be able 
to access objects stored in "" (which has a dictionary) after a 
command like "python" so that the objects saved in "" 
after execution can be retrieved and drawn in "".

> What do you mean by "view() is encounted"?

This is a command that the user can enter in will then 
encounter this command as python parses the file.
> How would you access the objects stored in Suppose you 
> them using a list called "list_of_objects". Then in
> import doc
> for obj in doc.list_of_objects:
>     do_something_with(obj)

I have tried this but there are no objects found in the dictionary in I am guessing that I have to execute so that it 
shares the same namespace with or maybe a way to access that 
namespace. This is the reason for my question.

> where you have to write the function "do_something_with", to do 
> it is you want to do.


KeMeniru at

More information about the Python-list mailing list