Open github-learning-lab[bot] opened 2 years ago
*** Please tell me who you are.
Run
git config --global user.email "you@example.com" git config --global user.name "Your Name"
to set your account's default identity. Omit --global to set the identity only in this repository. unable to commit from my laptop
Now you're ready to start coding. Let's get familiar with the files in our repo:
README.md
: a markdown introduction to this projectget-quote.py
: the file where we'll write our Python codequotes.txt
: a text file with a list of quotesOpen up
get-quote.py
and comment out line 2 by removing the#
from the beginning of the line. It will look like this:The two spaces (or one tab) in front of the line is important. Python uses whitespace to organize code. This print line is part of the
main()
function. But more on that in the next step. First, let's try running that Python script.Use the Python 3 command to run the script. From the command line, type one of the following:
python get-quote.py
python3 get-quote.py
You should see our first quote, the one hard-coded into line 2, printed out in your terminal:
Keep it logically awesome.
Push your changes
You've edited your local code, so you have a more recent version than is stored in this repository. You can check that any time by running:
git status
It should show one file modified. Every time we want to send our local changes to GitHub, we need to perform three steps:
git add get-quote.py
git commit -m "Hello World"
git push
Once you've completed these steps, we'll write some more Python.