If you already have Python 3 by default, you can choose to use “python” instead. Note: for the following of this tutorial I’ll still use the “python3” command. To do that simply run this command: echo "alias python=python3" > ~/.bashrc. This will make sure that when you type “python”, “python3” will be executed instead. If you still have Python 2 and just want to run Python 3 by default and not pay attention to the version anymore, you can add an alias in your bashrc. You can skip the following and jump to the next part of the tutorial.īut if you see something starting with “Python 2.x”, you’ll have to manually type “python3” to be able to use Python 3. Whether you type “python” or “python3”, you’ll use the correct version. If you see something starting with “Python 3.x”, then everything is fine. You are learning how to use Raspberry Pi to build your own projects?Ĭheck out Raspberry Pi For Beginners and learn step by step. If you have Python 2 and Python 3 installed on environment, then for the following you’ll want to make sure you only run scripts using Python 3, which is the newer and recommended version to use. However, this doesn’t mean that Python 2 has disappeared, or that it can’t work! In many systems Python 2 is still present, and the first thing you want to check is if it’s still there. Conclusion – running a Python script from the terminal in your Raspberry PiĬheck Python version on your Raspberry PiĪs you may now, Python 2 is not supported anymore since 2020.Run a Python script in the terminal of your Raspberry Pi.Write a Python program inside the terminal.Create and run Python scripts on Raspberry Pi.Run Python code directly on the terminal.Check Python version on your Raspberry Pi.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |