skip to Main Content

How to call a Perl script with couple of arguments with html tag from within a Python script using Subprocess/shell? HTML tagging not working

Within a python script I have a function which looks as below: def NotifierFunc(Mail, Ticket_Num, Open_DtTime): cmd = "/home/path/MyPerlScript.pl --channel 'MyChannel' --userid 'itsme' --message 'Hello <at>"+Mail+"<at> : The ticket <a href='`echo 'http://snview/'"+Ticket_Num+">`echo "+Ticket_Num+"`</a> is not closed for more than 72…

VIEW QUESTION

Python call Powershell Invoke-RestMethod with Json as string into Body

import requests import subprocess import base64 credentials = "login:password" url = f'urlXXXurl' body = '{"id": 4986986, "key": "2df534ee-270b-4ab4-83fb-1b308febacce", ...}' headers = '"""@{Authorization = 'Basic %s'}"""' % base64.b64encode(credentials.encode("ascii")).decode("ascii") command = 'powershell.exe Invoke-RestMethod -Method Post -Uri %s -ContentType application/json -Body """%s""" -Headers…

VIEW QUESTION

Using subprocess.Popen messing Ubuntu terminal output

Using subprocess.Popen messing Ubuntu terminal output import subprocess import time subprocess.Popen("sudo ./agt_internal", shell=True, cwd="/home/boblittle/AGT/") time.sleep(10) for i in range(10): print('Good Morning America') The terminal output is messed up. Any suggestions? def start_agt_pmlog(): command = 'sudo ./agt_internal -unilog=PM' args = shlex.split(command)…

VIEW QUESTION
Back To Top
Search