Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 879731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:58:51+00:00 2026-05-15T11:58:51+00:00

For practice, I’m trying to do some stuff in Python. I’ve decided to make

  • 0

For practice, I’m trying to do some stuff in Python. I’ve decided to make a simple hangman game – I’m not making a GUI. The game would start with a simple input(). Now, I’d like next line to, beside asking for input, to delete the hidden word. I’ve tried using \b (backspace character), but it’s not working. Something like:

word = input("Your word: ")
for i in range(len(word) + 12):
    print("\b")

Now, printing the backlash character is supposed to delete the input and “Your word”, but it isn’t doing anything. If I do this in IDLE I get squares, and I get nothing if I open it by clicking.

How to accomplish this? I’m afraid I wasn’t too clear with my question, but I hope you’ll see what I meant. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:58:52+00:00Added an answer on May 15, 2026 at 11:58 am

    I assume the player entering the word wants to be sure they’ve entered it correctly so you probably want to display the word as they’re typing it right?

    How about printing enough \ns to move it off the screen when they’re done or issue a clear screen command?

    You mentioned this was a simple game so a simple solution seems fitting.

    [Edit] Here’s a simple routine to clear the console on just about any platform (taken from here):

    def clearscreen(numlines=100):
        """Clear the console.
        numlines is an optional argument used only as a fall-back.
        """
        import os
        if os.name == "posix":
            # Unix/Linux/MacOS/BSD/etc
            os.system('clear')
        elif os.name in ("nt", "dos", "ce"):
            # DOS/Windows
            os.system('CLS')
        else:
            # Fallback for other operating systems.
            print '\n' * numlines
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to practice making making some xml and also a parser for
For practice I decided to rewrite string.c in C. I can not find online
For haskell practice I want to implement a game where students/pupils should learn some
I'm making practice with CakePHP user registration validation but I get some error from
To practice using pointers and arrays i'm trying to do a simple program capable
Is there a best practice for making an entity immutable? Users create exercises in
Is it bad practice to have a custom cursor on a website? Not just
I'm trying to practice jquery with webservices and callign on of he open xml
For practice I am trying to display a number that increments from 0 -
for practice purposes, I'm trying to find a way to print rows of numbers

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.