Closed christophwagnergillen closed 2 years ago
Python 2 vs Python 3 division. Processing.py uses Jython, which supports Python 2 --
print(5 / 2) # displays 2 (but 2.5 in Python 3)
print(5.0 / 2) # displays 2.5
You can convert your integers to floats --
bild_horizontal = 1920.
bild_vertikal = 1080.
...
Alternatively, you might import Python 3 division by adding this line to the top of your code --
from __future__ import division
print(5 / 2) # displays 2.5
Hello tabreturn,
Thanks a lot for the help. Very much appreciated. It works now perfectly :).
I have the following code on a Jupyter Notebook:
Running the code on a Jupyter notebook provides the following results:
0 0 3 2 5 3 7 4 11 6 13 7
If the same code runs on Processing, the following results are generated:
0 0 3 3 5 5 7 7 11 11 13 13
Where is my mistake?
Thanks a lot for your help. I have spend hours without resolving the issue.