It seems to me that “the right” is outraged over all the wrong things. Outrage over property damage instead of outrage over the repeated violent murder of black people by police (oh, and there is SO…
Python is currently the go-to coding language with many people eager to try and get involved but not quite knowing where to start. My aim here is to simplify the learning path for the most non-tech savvy of us who don’t want to get left behind. There’s no better way to learn than to jump in!
The purpose of this post is to help set your device up to start coding (Note: this is oriented towards Mac/PC users) and is broken out as below:
I’m a big fan of Atom’s simple user interface and its automatic colour-coding makes writing your code a lot more simple! On the site page above, you should see a download button that automatically populates according to your Operating System (Windows or Mac). Go ahead and install this on your computer.
You’ll want an easy to-navigate-to folder which contains your code. When you run your script in a program in the future, the program will need to know where the code file is stored to be able to read and run it. Also, start as you mean to go on — tidy organisation makes for happy learning.
For those wanting to learn/use python on the go, I’d recommend your location being cloud-based. Also, be sure to make a note of your folder location (/Users/{Username}/desktop/python/) for the future.
This is an all-you-can-eat buffet for launching applications running python without needing to use the command line. What this means is that you can install applications through this hub for your use in one location rather than many. We’ll be using Anaconda here for 1) installing python and 2) launching a “Jupyter Notebook”.
Here, we’ll be editing our code in a live environment so we can test it to make sure that it works. You’ll need extra packages in your “Atom” installation to be able to run live code as it’s just an editor in its primitive state.
Testing your code before saving and running it will save you lots of time — imagine having 1,000 lines of code and making changes that impact 5 lines of code only, rather than running the whole thing to check if your changes worked it would be a lot simpler to only run that snippet wouldn’t it?
In the future, we’ll move on to running python scripts from your terminal/command line but for now, we can stick to running scripts from Jupyter Notebook.
Step 2: Type into Line 1 “##” and then your file path (e.g. /Users/{Username}/desktop/python/). The hashtag results in a comment and the text following the hashtag won’t be run by python, it’s just a note for yourself. This will be useful when it comes to calling your script from other processes in the future.
Step 3: Hit Enter/Return twice to get to line 3 and type in the following—
print(“This is my first bit of python code”)
Step 4: Save your python script
Step 5: Launch Jupyter Notebook from the Anaconda Navigator
Step 6: Navigate to your designated python folder (e.g. /Users/{Username}/desktop/python/) within Jupyter Notebook.
Step 7: Select the “New” dropdown button and click on “Python 3” below the “Notebook” subheading.
This will open a new tab for your notebook, don’t worry your old tab is still there at the top!
Note: Jupyter Notebook stores your file as a .ipynb file, this file-type is specific to Jupyter Notebook which is why we aren’t skipping the creation of the script in Atom to just enter code directly into Jupyter Notebook.
Step 10: Click on the “Run” button.
Finished Article! Give yourself a pat on the back you ran a line of python code where you asked python to print text for you. With this, you have a solid foundation for furthering your learning with python.
For those of you that made it this far, thank you for reading and feel free to drop comments on how I could have improved my post; language, imagery, fun-ness… happy coding.
From a collection of writing. “Poetry Entry No. 1” is published by Heather Grey.
The latest Income paid proof within 24 hours. 100% likable Task Work. Get paid to easy method / Latest airdrop/best-paid Mining web. £10 USD Only Register and share Your Work get paid 10% /30% free…
To put my story into context. I founded a company from my home that wound up being the Hispanic Marketing Agency of record for the largest consumer goods company on the planet….for 23 years…I was a…