I’m new with Python and I created a method that clears the screen. Is it already saved somewhere in my computer so that everytime I call it in Python cmd I can use it?
Something to add:
Should I learn Python 2 or 3 is fine enough?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, it will be gone when you start a new session. If you want to add your shortcut so that it’s there every time you start python, you have a few options:
sitecustomize.pyfile, this may be platform dependent but for my system it is located at/usr/lib/python2.7/sitecustomize.py.ipy_user_conf.pyfor ipython. On unix systems it should be under~/.ipython/. I have actually already the same alias to clear the screen 3x on mine, by adding the lineo.autoexec.append('alias c clear; clear; clear')undermain()inipy_user_conf.pyThe adoption curve of python 3 is poor because many people are relying on packages that are still only supported properly by python 2.x. You should learn python 2 if you are going to use libraries that don’t have good python 3 support yet, otherwise learn python 3 because it does have many significant improvements. The authors have a tool to convert 2 to 3 which can handle most syntax stuff automatically, for simple enough code.