Hi Alsa, In the line where you save the file, you need to specify a selection, otherwise, everything will be saved Look at http://www.pymolwiki.org/index.php/Save#PYMOL_API
So instead of cmd.save(filenameN + '.mol') you want something like cmd.save(filenameN + '.mol', filename) I haven't tested this myself though. Hope this helps Folmer 2015-06-06 11:53 GMT+02:00 AE <alsalisb...@yahoo.com>: > Good day, > > I have several thousands of files, which I upload using the loop: > > myDir = ‘/dirWithFiles' > for filename in os.listdir(myDir): > cmd.load (filename) > filenameN = os.path.splitext(filename)[0] > cmd.save(filenameN + '.mol') > cmd.disable(filename) > > I am trying to save them one by one in a different (.mol) format. However, > the files are saved together, i.e.: first file opened contains only > molecule from the first file; second: first + second; third: first + second > + third etc. But I want firstFile.readableFormat to be converted into > firstFile.mol, secondFile.readableFormat - secondFile.mol etc, without any > addition of other files. How can I do that? > > Thank you, > > Best Regards, > > Alsa > > Sorry I have sent it already, accidentally forgot to finish the question > in subject( > > ------------------------------------------------------------------------------ > _______________________________________________ > 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 -- Folmer Fredslund
------------------------------------------------------------------------------
_______________________________________________ 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