0

I am new to working with the CLI (Command Line Interface), and I am trying to write a run script for my macOS terminal from a python 3. I followed all the instructions from cloning the repository on my local machine by installing Xcode-beta and cloning it on my local machine using Xcode-beta. I was able to fix [Errno 2] by dragging the code into the terminal to get the exact directory code line and then by using sudo I corrected the permission denied issue. Now I am having trouble with syntax error unexpected token ' ('. The following image shows the error I am getting. enter image description here

This is the error below as shown in the image from my command terminal: /Users/stevengomezroldan/Desktop/Github Projects/Github_Codinng_Projects/Python-Projects/python-random-quote/get-quote.py: line 1: syntax error near unexpected token (' /Users/stevengomezroldan/Desktop/Github Projects/Github_Codinng_Projects/Python-Projects/python-random-quote/get-quote.py: line 1: def main():'

Here is the script that was provided to run random logical expressions:

def main ():
   print ("Keep it logically awesome.")
   #f = open("quote.txt")
   #quotes = f.readlines()
   #f.close()

   #print(quotes)

if__name__=="__main__"
  main()

I working on some courses in Github, and I am trying to have the command terminal to print the expression "Keep it logically awesome."

Thanks for the help. I also have python3 (most recent installed) and recently installed Xcode-beta.

Fez_GRZ
  • 1
  • 3
  • The error message and the code do not match. – jordanm Oct 13 '20 at 15:14
  • May be this already has answers here - https://stackoverflow.com/q/21492214/13640294 – kartik sharma Oct 13 '20 at 15:25
  • 1
    @kartiksharma thank you for the link. They provided the answer there. I greatly appreciate the help. I was able to discover that before placing the directory path I needed to type python after the prompt dollar sign. By doing the following after the prompt: ```$ python3 /Users/stevengomezroldan/Desktop/Github\ Projects/Github_Codinng_Projects/Python-Projects/python-random-quote/get-quote.py ... I was able to get the terminal command to return the prompt. Again thank you. – Fez_GRZ Oct 14 '20 at 02:14

0 Answers0