I am trying to clean up some code so that it may be shared. The existing code contains URLs that if in the hands of the wrong people could be used to really confuse my device. The URLs contain keywords that an app on my phone process to do different things on my phone. I'd like to have the "KEY1" and "KEY2" in another script that will be imported. They are simply provided here to keep this more simple. I am trying to combine the three elements to create the URL, but it keeps inserting spaces and other punctuation before and after the alert. See the notes at the end to understand where.
When the spaces and other punctuation are added, this URL does not work to send the message to my phone.
When the spaces and other punctuation are added, this URL does not work to send the message to my phone.
Code:
KEY1 = "https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey=SECRETKEY&text="KEY2 = "&deviceId=SECRETDEVICE"alert = "jewelryopen"URL = (KEY1,alert,KEY2)print(URL)# This is what I get#('https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey=SECRETKEY&text=', 'jewelryopen', '&deviceId=SECRETDEVICE')# I want the output to show as below:#https://joinjoaomgcd.appspot.com/_ah/api/messaging/v1/sendPush?apikey=SECRETKEY&text=jewelryopen&deviceId=SECRETDEVICE'
Statistics: Posted by duckredbeard — Sun Jan 19, 2025 1:43 pm