Python Forum
eliminating letters when typed in python window
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
eliminating letters when typed in python window
#1
Hey there! I'm a novice trying to write program (using the turtle mod) that makes letters from a random word disappear (start to finish) as I type them. I wrote it out in my terminal using the print function and I have it working:

import random

word_list = ["thing", "crazy", "house", "proud", "train"]

def word_ch_5():
    x=random.choice(word_list)
    print(x)
    while len(x) >= 0:
         index = 0
         if x[index] == input():
             x = x[index+1:len(x)]
             print(x)

word_ch_5()
BUT I want this to work IN a turtle.Screen, not just in the terminal. How do I get the text to translate and react the same way, but in the python window? I am currently just using the pen.write function to make the text appear. Any help would be VERY MUCH APPRECIATED! Thank you!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Is there a way to call and focus any popup window outside of the main window app? Valjean 6 1,745 Oct-02-2023, 04:11 PM
Last Post: deanhystad
  Can't stop keyboard listener to grab chars typed inside CTk window Valjean 9 1,308 Sep-25-2023, 08:07 PM
Last Post: deanhystad
  Pyspark Window: perform sum over a window with specific conditions Shena76 0 1,167 Jun-13-2022, 08:59 AM
Last Post: Shena76
  Eliminating error in Python update-alternatives Led_Zeppelin 2 2,992 Apr-14-2021, 12:49 PM
Last Post: Led_Zeppelin
  Making lists using itertools and eliminating duplicates. mike3891 2 2,237 Oct-26-2020, 05:39 PM
Last Post: bowlofred
  Python Hangman Game - Multiple Letters Problem t0rn 4 4,642 Jun-05-2020, 11:27 AM
Last Post: t0rn
  Is Python strongly or weakly typed? amandio 3 3,117 Jul-13-2018, 12:33 PM
Last Post: amandio
  Python Hangman Replacing "_" with letters. 2skywalkers 6 12,069 Jun-25-2018, 12:01 PM
Last Post: gruntfutuk
  Python symbols AND letters gullidog 1 3,493 Apr-05-2017, 10:13 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020