Skip to content

Commit d56273e

Browse files
authored
Update python_sms.py
Replacing string concatenation with f-strings for readability
1 parent 0c55bf8 commit d56273e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

python_sms.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@
3636
snumber = row[1]
3737

3838
message = (
39-
sname
40-
+ " There will be NO training tonight on the "
41-
+ tdate
42-
+ " 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"
39+
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"
4340
)
4441

4542
username = "YOUR_USERNAME"
@@ -70,9 +67,9 @@
7067
postdata = urllib.urlencode(values)
7168
req = urllib2.Request(url, postdata)
7269

73-
print("Attempting to send SMS to " + sname + " at " + snumber + " on " + tdate)
70+
print( f"Attempting to send SMS to {sname} at {snumber} on {tdate}")
7471
f.write(
75-
"Attempting to send SMS to " + sname + " at " + snumber + " on " + tdate + "\n"
72+
f"Attempting to send SMS to {sname} at {snumber} on {tdate}"
7673
)
7774

7875
try:

0 commit comments

Comments
 (0)