How to code with python on your Chromebook with Linux

Image result for python

What is Python?

Python is a very reliable fully open source coding language with easy-to-use syntax. It's great for everyday programming use as well as high level programming.

Step One: Install Linux on Your Chromebook with Crouton

Step Two: Install Python

While in your Linux desktop environment, open your terminal and type:
$ sudo apt-get install python
Enter your sudo password when prompted.

Step Three: Install Mousepad Text Editor

In your terminal type:
$ sudo apt-get install mousepad
Enter your sudo password if prompted.

Step Four: Create Your First Python File

Open your file manager and navigate to the folder that you wish to create your file in. Right-click and select [Create Document]>[Empty File]. When you name it, make sure end the name with .py.
Open this new file in Mousepad by right-clicking on it and selecting "open in Mousepad".
When the window opens, type your python code. If you haven't used Python before or just don't know what to write, just type [print "Hello World"]. (A simple program to make the words "Hello World" appear).
Press [control]+[S] to save your file.

Step Five: Run Your Python File

First you need to navigate to the folder where your file is saved using the terminal. In the terminal type:
$ cd <Your File Path>
 
Example (If your file is saved to the "Downloads" Folder):
$ cd ~/Downloads

Then type:
$ python <Your_File>.py
 
If you used the command print "Hello World" as your file, the output should be:
Hello World
 
Now that you have Python running on your Chromebook, there are infinite possibilities of what you could make. There are also many more coding languages you can install and use including Javascript and C#. Check out some of my other blog posts to learn more about coding and many other things, all on your Chromebook! Make sure to comment and subscribe. Thanks for reading!

Comments