Skip to content

Cannot find MODE_OUT in Python #545

@smoe

Description

@smoe

Hello,

I have difficulties in writing a protein/system to a PDBFile. The problem may have its root for the specification of the OpenMode.

In [1]: from BALL import *
In [2]: testme = PDBFile("bla.pdb",File.MODE_OUT)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
 in ()
----> 1 testme = PDBFile("bla.pdb",File.MODE_OUT)
AttributeError: type object 'File' has no attribute 'MODE_OUT'

and I do not find the MODE_OUT elsewhere, either. A C++ implementation worked.

I then used the numerical value 1 directly as seen in

typedef std::ios::openmode OpenMode;

which then works

testme = PDBFile("bla.pdb",1)

and an empty file is indeed created but I still fail to write to it

system=System()
testme.write(system)
---------------------------------------------------------------------------
SystemError                               Traceback (most recent call last)
SystemError: 'finally' pops bad exception

The same happens with a protein, so I understand this is not depending on the actual content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions