From: Tsjerk W. <ts...@gm...> - 2008-02-22 09:07:14
|
Hi Hari, You can do it using: execfile("/Users/hari/Desktop/test.cgo") cmd.load_cgo(obj,"test") However, you might find it more convenient to drop the "obj =" from the .cgo file and load the thing with: cmd.load_cgo( eval( open("/Users/hari/Desktop/test.cgo").read() ), "test" ) Although that seems a bit more complicated, it's in fact quite easy to define as a function itself. Hmm, I think I'm gonna store my CGO objects just like that myself :) Hope it helps, Tsjerk On Thu, Feb 21, 2008 at 10:16 PM, hari jayaram <ha...@gm...> wrote: > Hi I have a running pymol session with nothing loaded. > I now want to load a cgo object into this session. > When I read in the cgo file using either command line (load > /Users/hari/Desktop/test.cgo , test ) or the GUI menu , I get an object > entry on the side panel but nothing shows up in the viewing window. > > I can successfully load any cgo file using a python script . I want to > learn how to "inject" a cgo object like the one given below into a running > python session . > Can someone tell me how to do this. > > Your help is greatly appreciated > Thank You > Hari Jayaram > Brandeis University > > #Contents of test.cgo file > > obj = [ > > BEGIN, LINES, > > COLOR, 1.0, 1.0, 1.0, > > > > > VERTEX, 0.0, 0.0, 0.0, > > VERTEX, 1.0, 0.0, 0.0, > > > > > VERTEX, 0.0, 0.0, 0.0, > > VERTEX, 0.0, 2.0, 0.0, > > > > > VERTEX, 0.0, 0.0, 0.0, > > VERTEX, 00, 0.0, 3.0, > > > > > END] > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > > -- Tsjerk A. Wassenaar, Ph.D. Junior UD (post-doc) Biomolecular NMR, Bijvoet Center Utrecht University Padualaan 8 3584 CH Utrecht The Netherlands P: +31-30-2539931 F: +31-30-2537623 |