Skip to content

Commit

Permalink
Update python_sms.py
Browse files Browse the repository at this point in the history
Replacing string concatenation with f-strings for readability
  • Loading branch information
rein14 authored Sep 20, 2022
1 parent 0c55bf8 commit d56273e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions python_sms.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
snumber = row[1]

message = (
sname
+ " There will be NO training tonight on the "
+ tdate
+ " Sorry for the late notice, I have sent a mail as well, just trying to reach everyone, please do not reply to this message as this is automated"
f"{sname} There will be NO training tonight on the {tdate}. Sorry for the late notice, I have sent a mail as well, just trying to reach everyone, please do not reply to this message as this is automated"
)

username = "YOUR_USERNAME"
Expand Down Expand Up @@ -70,9 +67,9 @@
postdata = urllib.urlencode(values)
req = urllib2.Request(url, postdata)

print("Attempting to send SMS to " + sname + " at " + snumber + " on " + tdate)
print( f"Attempting to send SMS to {sname} at {snumber} on {tdate}")
f.write(
"Attempting to send SMS to " + sname + " at " + snumber + " on " + tdate + "\n"
f"Attempting to send SMS to {sname} at {snumber} on {tdate}"
)

try:
Expand Down

0 comments on commit d56273e

Please sign in to comment.