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

And that's is pretty much it.


  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.

  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.


Post a Comment

Popular posts from this blog

Libgdx: Create Item Database using JSON files

This blog post describes how to create an Item database using libgdx JSON parser and storing it in a Collections object to retrieve from.

0.) Create the JSON fileSave this as "weaponDb.json". This JSON object is used to create a list of Items in which we can grab items from.
[ { "id": 1, "name": "Dumb Basic Sword", }, { "id": 2, "name": "Bad Ass Flaming Sword", }, { "id": 3, "name": "Sword of Kick Ass", } ]1.) Create the testA simple JUnit test to test our database
import com.mygdx.items.Item; import com.mygdx.items.ItemLoader; import org.junit.Test; import; import java.util.ArrayList; /*Simple Test Case*/ public class TestDb { @Test public void testDb() throws IOException { ItemLoader itemLoader = new ItemLoader(); ArrayList database = itemLoader.load("weaponDb.json&…

Inkscape: Kawaii Friends

Did this one for work.
Download svg file here: kawaii_friends

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.