Is there an error output? I could see it not working if File10 is not located in the present working directory. If you are running the script by using the load command in pymol you can type pwd or cmd.pwd() on the input line to see the present working directory. The best bet to fix the problem is to prefix the absolute path to the directory with the pdb files. Like so:
cmd.load(‘/home/me/pdbs/‘ + X + ‘.pdb’, x) Alternatively you can use the cd (change directory) command to move pymol’s pwd to the directory containing the pdbs, then you can run the load myscript.py command. Regards, Gabriel Marques > On Oct 20, 2016, at 1:06 PM, Subha K <subhal...@gmail.com> wrote: > > Hi there, > > If the base name of my file is stored in a variable, how can I load the file > using the variable? > > Eg., My filename is "File10.pdb" > and I have, X = File10 > > I tried loading it using, > cmd.load ( X+".pdb", X), but it doesn't seem to work. > > Sorry for posting a very basic question. > > Thanks, > Subha > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, SlashDot.org! > http://sdm.link/slashdot_______________________________________________ > PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) > Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users > Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, SlashDot.org! http://sdm.link/slashdot _______________________________________________ PyMOL-users mailing list (PyMOL-users@lists.sourceforge.net) Info Page: https://lists.sourceforge.net/lists/listinfo/pymol-users Archives: http://www.mail-archive.com/pymol-users@lists.sourceforge.net