> Hi, since Paul's offline or busy (good luck to him!), can anyone
> provide
> me with a scheme-to-python translation for this code snippet?  Paul
> sent
> it to me, it's for re-loading a file into the same molecule.
>
> In particular, I don't know how to translate the last two lines,
> because
> I apparently misunderstood what they do in scheme (being no schemer).
>
>  (define mol2-pdbFile "somePDBfile.pdb" )
>  (define mol2-model (read-pdb mol2-pdbFile))
>  (define (read-mol-again)
>          (clear-and-update-model-molecule-from-file mol2-model
> mol2-pdbFile))
>  (read-mol-again)

It's easy to translate into python, just remember 2-3 rules and you are almost done (for simple things):

1. replace all '-' (which are not an arithmetic minus) with '_'
2. move the brackets around the arguments
3. replace (most) defines with = and others (functions) with def

So, here we go:

mol2_pdbFile = "somePDBfile.pdb"
mol2_model = read_pdb(mol2_pdbFile)
def read_mol_again():
        clear_and_update_model_molecule_from_file(mol2_model, mol2_pdbFile)
read_mol_again()

N.B. not tested, just translated...

> Am I correct in observing that wincoot does not do scheme?

Well, it can now but I removed it from the distribution as most of the scheme graphics parts are not properly working (obviously not my fault but scheme's ;-) ).

Bernhard

Reply via email to