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

plot_forces.py not working #4

Open
meouda opened this issue Jul 2, 2018 · 1 comment
Open

plot_forces.py not working #4

meouda opened this issue Jul 2, 2018 · 1 comment

Comments

@meouda
Copy link

meouda commented Jul 2, 2018

Dear Sir,

Thanks for the great tutorial.

I am trying to plot the forces using the supplied python script (plot_forces.py) but it returns the following error:
Traceback (most recent call last):
File "./plot_forces.py", line 41, in
data_dict = line2dict(line)
File "./plot_forces.py", line 18, in line2dict
floats = [float(x) for x in tokens]
ValueError: invalid literal for float(): -2.6235e-13,0.0459128

So, what is the reason for this error? and which python version you are using?

Best regards.

@meouda
Copy link
Author

meouda commented Jul 2, 2018

Solved. For anyone facing the same problem add the following line:
line=line.replace(",", " ")
before:
tokens_unprocessed = line.split()

This is to avoid problems with the split() method because split()uses whitespace as default separator

Best regards.

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

1 participant