+ 1
Can you test this Python script please.
https://code.sololearn.com/c8R55oNk4DZ1/?ref=app I posted this before leaving for work. Someone told me it returned an error. I believe I fixxed it but I am at work and cannot copy it back to my PC to make sure. Please test it for me. And not on the code playground. The script requires a lot of user input and that just really diesnt work out well on the playground. So paste it into IDLE or whatever you prefer. Thanks.
6 Respuestas
+ 4
You have effectively a command wich is platform dependant, and could be more or less probematics depending on OS running your script ^^
I tested it on android tablet, and it print 'sh: cls: not found' instead of clear screen :P
You should replace all:
os.system("cls")
... by:
print('\33[f\33[2J')
... wich do the same thing more crossplatform (some terminal/console should even not be compatible with ANSI escape sequence command, but less than those wich will be not compatible with the shell command 'cls' ^^
+ 3
os.system() is a function from standard library so it's cross-platform, but it's purpose is to exit Python interpreter and execute a command of shell, which are independant from Python and totally dependant of shell executed ^^
0
Hi Spock,
I tested your code; to my knowledge, everything seems to look in tact.
Good job, I liked the script you made. Keep it up!
0
@AlexLSD awesome thank you.
0
Seems to be working. Says I'm frisky_cat568
0
@visph Well, I hadnt even considered that it might not be cross platform since I only used the standard library. Thanks for the excellent suggestion. I'll try to remember to start using that instead of "cls". Its always nice to learn easy solutions to big problems.