Hello,
I know this not directly related to this class (which I plan to take shortly) but I thought it would be the best place to ask a python scripting question on a lab. I was working through the EC2 scaling with SQS lab and got the following error when I attempted to run the send_messages.py script:
while True:
try:
message = str(uuid.uuid4())
logging.info("Sending message: " + message)
response = sqs.sendmessage(QueueUrl=queueurl, MessageBody=message)
logging.info("MessageId: " + response["MessageId"])
sleep(args.interval)
except ClientError as e:
logging.error(e)
exit(1)
[cloud_user@ip-10-0-1-187 ~]$
[cloud_user@ip-10-0-1-187 ~]$
[clouduser@ip-10-0-1-187 ~]$ python sendmessages.py
File "send_messages.py", line 27
logging.info(f"Getting queue URL for queue: {args.queue_name}")
^
SyntaxError: invalid syntax
[clouduser@ip-10-0-1-187 ~]$ nano sendmessages.py
[clouduser@ip-10-0-1-187 ~]$ nano sendmessages.py
[clouduser@ip-10-0-1-187 ~]$ python sendmessages.py
File "send_messages.py", line 35
logging.info(f"Queue URL: {queue_url}")
^
SyntaxError: invalid syntax
[clouduser@ip-10-0-1-187 ~]$ nano sendmessages.py
[clouduser@ip-10-0-1-187 ~]$ python sendmessages.py
File "send_messages.py", line 35
logging.info(f"Queue URL: {queue_url}")
^
SyntaxError: invalid syntax
I tried to edit the script by commenting out the lines with errors (not sure this would work anyway) but I could not get any of my changes to run in the next time I ran the script. Would you be able to take a look at the above error and offer a workaround?
Thanks