This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
No matter what I do, I can't get a clear screen to work when I run my python code through command prompt. I have a windows machine and running 'cls' in command prompt will clear the screen but I can't seem to find any way to make that work in code. At best, it does nothing. At worst, I get an error code. (Also, sorry, I can't seem to figure it why reddit is displaying some of the code weird on here)
I have tried: cls 'cls' ('cls') system(cls) system('cls') os.system(cls) os.system('cls')
Here is what I'm working with (the clear screen is towards the end):
import pandas as pd
CS = pd.DataFrame({"NAME" : (pd.Series(["Name","Name","Name","Name","Name"])) })
CC = 1
while True:
print("Select (type into the command field) from the following character options:")
print("\n'Name' to update your name.")
print("'Stop' to finish character edits")
print("\n(Note: don't worry, you will be able to update any of these options in the future if anything changes.)\n")
X = input().upper()
if X == 'STOP':
print("All of who you are is valid and amazing.")
print(CC)
break
elif X == ('NAME'):
Y = str(input("What would you like to be called? "))
if Y == "New":
print("We're so sorry! We need to keep 'New' reserved for setting up new characters. Can you please pick something else?")
else:
CS.loc[CC,"NAME"] = Y
print('Hello ' str(CS.loc[CC,"NAME"]), ", we're so glad you're here!.\n\n")
os.system('cls')
continue
print(CS)
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnprogra...