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

Popular posts from this blog

Inkscape Game Character #4

This one goes to the fellows a PopCap Games . This is a plant pod from the game Plants vs Zombies.   If you would like to study the drawing feel free to download the Inkscape SVG file. Right click then hit save link as: plantpod.svg All rights reserve to the original artists.

New Angry Birds(Maybe)

So I'm a huge fan of angry birds and while playing the game I thought hey I want to make some birds to break things. So here are some of the birds I created (with the exception of the first one). Let me know what you guys think. If you would like to study the drawing feel free to download the Inkscape SVG file. Right click then hit save link as: newbirds.svg All rights reserve to the original artists.

Mobile App UI Mockup

Here is a mock up on the UI I want to "try" for my application. Enjoy. Download link on request.