Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System Commands #5

Open
TotallyNotAHaxxer opened this issue Jan 7, 2022 · 0 comments
Open

System Commands #5

TotallyNotAHaxxer opened this issue Jan 7, 2022 · 0 comments

Comments

@TotallyNotAHaxxer
Copy link

So I’m not going to really “ complain “ about this more than I am helping out, I notice you use the if system == to use a clear command, well there is a very simple solution to this, this works for all platforms and systems but instead of taking up extra lines you could always do this

‘’’python

if name == “main”:
print(“ \x1b[H\x1b[2J\x1b[3J”)
banner()
main()
‘’’

It took me a special someone to come along and teach me this but this is a very simple thing to both understand while optimizing code for cross platform applications, it will do the same thing clear and CLs will do but instead chomp down say the 7-8 lines the if system == whatever os, and this also works in any language and platform, it’s highly suggested to use it cause even I have found out in other languages when executing OS commands, windows will usually error out and say “ cls “ or “ CLS “ is not an executable path, so it just prevents a lot of heard ache working with cross platform applications

Happy coding! :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant