Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.pos files do not open in Windows systems #1

Open
ramav87 opened this issue Oct 11, 2016 · 2 comments
Open

.pos files do not open in Windows systems #1

ramav87 opened this issue Oct 11, 2016 · 2 comments
Assignees

Comments

@ramav87
Copy link

ramav87 commented Oct 11, 2016

.pos files do not open correctly in Windows systems. Can be fixed by adding option to open as binary file, ie., in function read_pos, change to:

n = len(file(f, 'rb').read())/4
d = struct.unpack('>'+'f'*n,file(f, 'rb').read(4*n))
@oscarbranson
Copy link
Owner

Thanks @ramav87. I've made your suggested change. Can you test it?

@SvenPVoigt
Copy link

SvenPVoigt commented Nov 29, 2017

Thank you for the code. The read_pos function wasn't working correctly for me in jupyter notebook- error could not find file(). Made the following adjustment if anyone needs it:

    with open(pathAPT, 'rb') as f: 
        data = f.read()
    n = int(len(data)/4)
    d = struct.unpack('>'+'f'*n,data)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants