Ngtungfei / Graphene-Oxide-Generator2

A tool to draw Graphene Oxide 3D chemical structures. (Python 3.6)
7 stars 5 forks source link

tkinter problem #3

Open yel21 opened 9 months ago

yel21 commented 9 months ago

Hello!

I tried to run code. The graphical windows was loaded, however no all machine I got the error

return self.tk.getdouble(value) _tkinter.TclError: expected floating-point number but got "1,0" no edges, no bulk atoms affected Could you please help me? As I clearly understand, the problem is in the tkinter package? Did anyone have similar problems?

Best regards, Victor

Kouroshdan commented 9 months ago

It seems that the error message you provided indicates a problem with the tkinter package rather than a machine issue.

The error message "_tkinter.TclError: expected floating-point number but got "1,0" is telling you that tkinter is expecting a floating-point number (a number with a decimal point), but it's getting the string "1,0" instead.

The problematic code might be inside the functions buildhexahapto, buildgraphene, or buiildarallelogram which you're calling using bup, bug, and bupar. These functions are probably receiving a string where they should receive a float.

To help you further, it would be useful to know which specific line of code is causing the error. If you could provide the traceback, that would be great.

However, I can suggest a temporary solution for this problem. You can replace the string "1,0" with the float number 1.0.

You can use the following code snippet to convert a string with a comma as the decimal separator to a float: float_value = float(value.replace(',', '.')) Make sure to replace value with the variable or string containing the problematic number.

yel21 commented 9 months ago

Hello!

Thank you very much for your help! The problem was solved when I switched to the Windows machine and used the tinker that was installed by anaconda.

Best regards, Victor