Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

1
Windows python clear screen command
Post Flair (click to view more posts with a particular flair)
Post Body

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)

Author
Account Strength
100%
Account Age
8 years
Verified Email
Yes
Verified Flair
No
Total Karma
16,910
Link Karma
2,126
Comment Karma
14,284
Profile updated: 6 days ago
Posts updated: 2 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago