Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40952

Re: Running external module and accessing the created objects

From Kene Meniru <Kene.Meniru@illom.org>
Subject Re: Running external module and accessing the created objects
Followup-To gmane.comp.python.general
Date 2013-03-09 10:34 -0500
Organization illom.org
References <mailman.3110.1362798411.2939.python-list@python.org> <513aecd3$0$6512$c3e8da3$5496439d@news.astraweb.com>
Newsgroups comp.lang.python
Message-ID <mailman.3130.1362843307.2939.python-list@python.org> (permalink)

Followups directed to: gmane.comp.python.general

Show all headers | View raw


OK. Sorry to have caused all the confusion. Let me try this again.

To use my program the user needs a script file I will call user.py. 
Functions from my program must be imported into this file with 
something like "from myapp import *".

myapp.py is a module in my program that has all the functions that the 
user needs to describe building components. There is also a main 
controller object that is imported into myapp.py module called app.

When python parses user.py module, the functions the user has provided 
creates building components which are then saved in a dictionary 
located in an object called doc that is part of my program. 

The user is free to use the functions in myapp.py to describe building 
components. When this process is complete or when the user wants to 
view their work-in-progress, they have to place a function called 
view() on the last line in user.py. This function currently exports 
the components into POV-Ray or OpenSCAD format. These are CAD programs 
that read script files to render or create images of the described 
artifacts. So this means that to view their work the user needs to run 
python on user.py to export the building and then run POV-Ray or 
OpenSCAD on the exported file to see the building.

I want to make it possible for the user to preview the building 
components without having to use the external rendering programs. I 
can currently have the app object provide this preview but it means 
that the user will have to process user.py with python then exit the 
graphic window each time they need to see changes.

So the solution I am looking for is to have a graphic window open that 
watches user.py for changes. If there is a change the graphic window 
updates the rendition of the created components without further 
intervention by the user. However this means that the graphic must 
somehow run python to parse user.py and then be able to access the 
objects stored in doc so that the coordinates can be used to update 
the view. This is where I am having difficulty.

I hope this is clearer.
-- 

Kene
::::::::::::::::::
KeMeniru@gmail.com

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Running external module and accessing the created objects  Kene Meniru <Kene.Meniru@illom.org> - 2013-03-08 22:06 -0500
  Re: Running external module and accessing the created objects Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-09 08:03 +0000
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 06:05 -0500
      Re: Running external module and accessing the created objects Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-09 11:34 +0000
    Re: Running external module and accessing the created objects Chris Angelico <rosuav@gmail.com> - 2013-03-09 22:47 +1100
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-09 07:02 -0500
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 10:34 -0500
      Re: Running external module and accessing the created objects Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-09 08:51 -0800
        Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 12:21 -0500
          Re: Running external module and accessing the created objects Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-09 10:33 -0800
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-09 11:12 -0500
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 11:56 -0500
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-09 12:20 -0500
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 12:39 -0500
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-09 13:18 -0500
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-11 19:57 -0400
      Re: Running external module and accessing the created objects Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-11 23:40 -0700
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-11 20:48 -0400
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-11 21:23 -0400
    Re: Running external module and accessing the created objects Kene Meniru <Kene.Meniru@illom.org> - 2013-03-11 21:58 -0400
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-11 22:16 -0400
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-11 22:11 -0400
    Re: Running external module and accessing the created objects Michael Torrie <torriem@gmail.com> - 2013-03-11 22:05 -0600
    Re: Running external module and accessing the created objects Dave Angel <davea@davea.name> - 2013-03-12 07:20 -0400
    Re: Running external module and accessing the created objects Kene Meniru <kemeniru@gmail.com> - 2013-03-12 13:38 +0000
    Re: Running external module and accessing the created objects Kene Meniru <kemeniru@gmail.com> - 2013-03-12 13:28 +0000

csiph-web