'Input() function works inconsistently, python 3.8.10, spyder 5.3.0, IPython 7.32.0
The code
print("Some text")
integer=int(input("Enter an integer: "))
is expected to print "Some text\nEnter an integer: " and read the users input, but some of the time it prints "Some textEnter an integer: \n" and reads the users input, so some of the time input() executes before the separator is printed.
On further inspection, the problem seems to be with IPython 7.32.0 multiprocessing(I believe that to be the case because this code works fine in the terminal, but doesn't work in Spyder's IPython console). Is there a way to fix that without resorting to the standard console?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|