dunwise / python-random-quote

A file-based quote bot written in Python
https://lab.github.com/everydeveloper/introduction-to-python
0 stars 0 forks source link

Run your first Python program #2

Open github-learning-lab[bot] opened 3 years ago

github-learning-lab[bot] commented 3 years ago

Now you're ready to start coding. Let's get familiar with the files in our repo:

Open up get-quote.py and comment out line 2 by removing the # from the beginning of the line. It will look like this:

  print("Keep it logically awesome.")

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:

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:

  1. Add the file(s) with changes: git add get-quote.py
  2. Commit the changes: git commit -m "Hello World"
  3. Push the changes: git push

Once you've completed these steps, we'll write some more Python.

dunwise commented 3 years ago

print("keep it simple")

keep it simple

dunwise commented 3 years ago

fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using

git remote add <name> <url>

and then push using the remote name

git push <name>

root@PANDORA-HP-EliteBook-820-G1:/home/rigadho/Documents/python-random-quote-master# git push bash: syntax error near unexpected token `newline' root@PANDORA-HP-EliteBook-820-G1:/home/rigadho/Documents/python-random-quote-master# git push dunwise fatal: The current branch master has no upstream branch. To push the current branch and set the remote as upstream, use

git push --set-upstream dunwise master

root@PANDORA-HP-EliteBook-820-G1:/home/rigadho/Documents/python-random-quote-master# git push --set-upstream dunwise master fatal: 'dunwise' does not appear to be a git repository fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. root@PANDORA-HP-EliteBook-820-G1:/home/rigadho/Documents/python-random-quote-master#

what else to do?