Skip to main content

Python 3.2 Bug: input() Module

After countless hours of programming of trial and error. I have found the solution to the input() bug.
Option 1: Revert back to python 2.7 until this is fixed.
Option 2:  It seems that \r is trailing the input so the fix is...


#python version 3.2

string = input("-> Your input here: ")

#The fix
string.strip("/r")


And that's is pretty much it.

Comments

  1. What is the bug you're encountering?

    >>> string = input("-> Your input here: ")
    -> Your input here: This is the input.
    >>> string
    'This is the input.'


    Is what I get when I run it.

    ReplyDelete
  2. The Bug was in Python version 3.2 when you would drag and drop a file into the terminal/command line(WindowsNT) in which it gets the file path. However, the path is trailed with '\r' at the end... This issue may only be present on Windows OS. I haven't tried it on Linux and Mac yet. Let me know how it works for you on your window installation.

    ReplyDelete

Post a Comment