Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Need help for extractring keys from dictionary
Post: Need help for extractring keys from dictionary

Have this code: if mail["Subject"].find("Alert for Ta*** prod errors") > 0 : body = get_autosys_body(mail) info = {} segments = body.split(' ') for line in...
dragan979 General Coding Help 3 3,012 Jan-23-2019, 10:59 AM
    Thread: Help with regular expresions-SOLVED
Post: RE: Help with regular expresions

People from SO helped a lot: regex2 = r'\bMACHINE:\s*(?:=.*)?\s*([^<^\n ]+)|$' ​machine = re.findall(regex2, email_body)[0]
dragan979 General Coding Help 3 2,599 Jan-10-2019, 03:06 PM
    Thread: Help with regular expresions-SOLVED
Post: Help with regular expresions-SOLVED

I already posted this on Stack Overflow I have emails which have following in email body: 1 email: Event demon log entry: *** 2.email: Event demon log entry: *** 3 email: Event demon log entr...
dragan979 General Coding Help 3 2,599 Jan-10-2019, 12:01 PM
    Thread: Python-for loop print into single line
Post: RE: Python-for loop print into single line

Already tried it and it works, however, i need to export print output to some variable, so i can pass that variable to function for sending email so i tried body=str(print(name,"")), but then getting...
dragan979 General Coding Help 4 7,075 Nov-22-2018, 03:04 PM
    Thread: Python-for loop print into single line
Post: Python-for loop print into single line

Code bellow prints each line for multiple output. Is it possible to print this output into single line: reservations = ec.describe_instances().get('Reservations', []) for reservation in reser...
dragan979 General Coding Help 4 7,075 Nov-22-2018, 08:50 AM
    Thread: lambda-Amazon EC2:Remove instance termination protection if enabled and terminate ins
Post: lambda-Amazon EC2:Remove instance termination prot...

I have following task: 1.Check if the instance has a tag "Terminate_On" If yes: 2.Check if the instance should be terminated today If yes: 3.Remove instance termination protection if enabled Term...
dragan979 General Coding Help 0 3,366 Jun-13-2018, 09:48 AM
    Thread: Unable to parse JSON output
Post: RE: Unable to parse JSON output

solved it: for issue in data['issues']: for subtask in issue['fields']['subtasks']: #if subtask['fields']['summary'] == 'The specified directory could not be found in the specified region.-traid...
dragan979 General Coding Help 1 3,552 Apr-20-2018, 02:24 PM
    Thread: Unable to parse JSON output
Post: Unable to parse JSON output

I'm searching JIRA using REST API and trying to get subtask name (summary) whole code is here: https://1drv.ms/u/s!AizscpxS0QM4hJpFPnbeAexYPwYu9Q I need from this section in file to get summary (Rem...
dragan979 General Coding Help 1 3,552 Apr-20-2018, 07:35 AM
    Thread: For Loop, execute one time for every loop iteration
Post: RE: For Loop, execute one time for every loop iter...

Solved after few days: JSON: Output: { "squadName": "Super hero squad", "homeTown": "Metro City", "formed": 2016, "secretBase": "Super tower", "active": true, "customers": [ { ...
dragan979 General Coding Help 2 4,447 Feb-20-2018, 12:02 PM
    Thread: For Loop, execute one time for every loop iteration
Post: For Loop, execute one time for every loop iteratio...

Hi, i'm new to python. I created a script to iterate through JSON file to find field email address, and remove part after @. This value is username for EC2 instance which will be created using terraf...
dragan979 General Coding Help 2 4,447 Feb-14-2018, 03:46 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020